I am having trouble replicating this command from CMD
set APPDATA=D:\
.
The best equivalent I have is Set-Variable -Name $env:APPDATA -Value D:\
. This does not work!
The full script is:
set APPDATA=D:\
start java -jar D:\.minecraft\minecraft.jar
This sets it so Java looks in D:\
for .minecraft
instead of APPDATA
.
The full PowerShell version (which doesn't work right) is:
& Set-Variable -Name $env:APPDATA -Value D:\
& 'C:\Program Files\Java\jre1.8.0_66\bin\java.exe' -jar D:\.minecraft\Minecraft.jar
It still looks at the read-only version of $env:APPDATA
. I don't see why it can't be changed in the running environment for the shell's session, like cmd and most *nix shells!
I'm sure there are more uses for this than just running Minecraft. :P