$adobe = "C:\Acrobat Pro DC"
$computer = Read-Host -Prompt "Computers Name"

$destination = "\\$computer\c$\temp"

Copy-Item -Recurse -Path $adobe -Destination $destination

Enter-PSSession $computer
Test-Path "c:\temp\Acrobat Pro DC\Adobe Acrobat"

Set-Location "c:\temp\Acrobat Pro DC\Adobe Acrobat"
Start-Process "install_acrobat.bat"

Above is the current code I am using. The Test-Path keeps returning false even though the folder does exist, and the Set-Location says the folder does not exist either. What am I missing?

  • does the account you are using for this have permission to see that location? your previous access what thru the hidden c$ share ... the permissions on those are not required to be the same ... [grin] – Lee_Dailey Nov 27 '18 at 18:09

If it is a script file then the commands after Enter-PSSession do not run in that session as explained on MS social technet.

Your Answer

