Hey Guys,
I am almost there but feel I am missing something that is right in front of me and need another set of eyes.
I am trying to run the following powershell file with the following parameters. This works in powershell just fine.
Reset-LocalAdminPassword.ps1 -Password $secureString
I created an autoit script to do a few other things but from venturing in the forums I found some code and did the following:
;THIS COMMAND WILL RUN THE powershell script
$iDir = "C:\test\script\Reset-LocalAdminPassword.ps1"
Run('cmd /k C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File ' & '"' & $iDir & '-Password $secureString')
Sleep(15000)
The problem is that when it runs it gives me a message that C:\test\script\Reset-LocalAdminPassword.ps1-Password $secureString' is not a valid ps1 file.
I cannot seem to get it to run the ps1 file with the -Password $secureString' parameter. It keeps cobining the ps1 path and the parameters all as one.
I am sure this is something I am overlooking but I have been battling with this for a few hours now and just don't know what I am missing.