I am trying to execute the below PowerShell code in Jenkins and see the 
SUCCESS message, but in the control panel, the application still remains as 
it is. I have downloaded the PowerShell plugin to directly execute 
PowerShell scripts.

I can execute the script manually without an issue.

Windows Powershell script code:

$uninstallString = gci 
"HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | 
foreach { gp $_.PSPath } | ? { $_ -match "program name" } | select 
BundleCachePath
if ($uninstallString -ne $null){Start-Process $uninstallString.
BundleCachePath -ArgumentList "-Uninstall -Quiet -Wait"}else{Write-Host 
"Uninstall 
string not found!"}

I have also tried to run the command using "&" operator:

& "G:\uninstall\uninstall.ps1


I have created a freestyle project to do so.

I am not seeing any error after running the job. Is there something I am 
missing or I need to configure?

Building in workspace C:\Program Files (x86)\Jenkins\workspace\Uninstall_ORD
[Uninstall_ORD] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& 
'C:\Windows\TEMP\jenkins6372953575964806337.ps1'"
Finished: SUCCESS

Thanks,
H

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5c59f418-f37e-42e6-9733-1dcb18fc7d5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to