Once again, this GREATLY dumbed down to simplify the error. I have a bat file that maps a local drive from a UNC share. Contents of my bat file (map.bat) are:
net use Z: "\\myserver\e$\apps\Data" /USER:mydomain\myuser mypass
The bat file works flawlessly, and I can then look at my Z: files from windows explorer. When I run the bat file from a powershell command, it says it completes successfully, yet I cannot see the Z: drive. Contents of my powershell are:
Invoke-Command-ComputerNamelocalhost-ScriptBlock{E:\Scripts\Setup\Company\Map.bat}
This makes no sense to me at all. If the bat works, why wouldn't the powershell?
mpleaf