Currently have a PowerShell script that's supposed to get content of the file on a remote computer:
$send = gc \\$env:COMPUTERNAME\c$\$WINDOWS.~BT\Sources\Panther\setupact.log | Select-String uninstall
Obviously, when using PDQ Deploy, the target computer that is chosen will fill in for the $env:COMPUTERNAME variable. However, when the script is deployed by PDQ, it keeps failing wi/ this error:
Get-Content : Cannot find path '\\nameOfComputerHere\c$\.~BT\Sources\Panther\setupact
.log' because it does not exist.
At C:\Windows\AdminArsenal\PDQDeployRunner\service-1\exec\smh.ps1:8 char:15
+ $send = gc <<<< \\$env:COMPUTERNAME\c$\$WINDOWS.~BT\Sources\Panther\setu
pact.log | Select-String uninstall
+ CategoryInfo : ObjectNotFound: (\\nameOfComputerHere\...er\setupact.l
og:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetCo
The file definitely exists as if I run this script manually and hard code the remote computer's name, it works just fine. Any help will greatly be appreciated.
Please sign in to leave a comment.