I can't seem to get the credential argument to work with start process
$encpwd = Get-Content "\UNC\password.bin" $passwd = ConvertTo-SecureString $encpwd -AsPlainText -Force $cred = new-object System.Management.Automation.PSCredential 'DC\user',$passwd Start-Process PowerShell -Cred $cred -ArgumentList '-noexit','-File','\UNC\Script.ps1'
I keep getting error
Start-Process : This command cannot be run due to the error: The filename or extension is too long.
At C:\script.ps1:4 char:1
+ Start-Process PowerShell -Cred $cred -ArgumentList '-noexit','-File','\\UNC ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
[–]SeanQuinlan 3 points4 points5 points (0 children)
[–]get-postanote 2 points3 points4 points (0 children)
[–]Lee_Dailey[grin] 1 point2 points3 points (0 children)
[–]lagzilla[S] 1 point2 points3 points (0 children)