Hello,
I'm looking to run a powershell script (.ps1) on Windows node (A) using WinRM and CredSSP.
I tested the script and it works locally.
The script must purge a folder and save files remotely on shared directory (B).
After passing looking online i try this in rundeck job, but, job seems to run well but nothing is performed:
Job specifications:
Password: stored in key storage (options variable: @option.password@)
Invocation String: powershell.exe -File
File Extension: .ps1
------------------------------------------------------------------------------------------------
$password = @option.password@
$username = "DOMAIN_USER"
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential $username, $securePassword
Start-Process -FilePath "\path\to\script.ps1" -Credential $credential
-----------------------------------------------------------------------------------------------------
Execution result
Jobs seems to run well but nothing was performed.
Am I doing well or something Wrong?
Best Regards