When I run powershell_script resource I’m getting the below error,all my Commands are appended with ‘A’ as shown below
command:-
$credential = New-Object System.Management.Automation.PSCredential($username,$securePassword);
Error:-
STDERR: The term ‘New-ObjectA’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Thanks Spuder,That helped me
However I’m again getting a different error:This command cannot be run due to the error: Access is denied.
when running the below code,I guess some permission Issue with system user,please let me know how to run this
$username=’“username”’
$password=’“password”’
$securePassword=ConvertTo-SecureString $password -AsPlainText -Force
$credential=New-Object System.Management.Automation.PSCredential $username, $securePassword
Start-Process powershell.exe -Credential $credential -NoNewWindow -ArgumentList “”