I have a example.ps1 file in which i am trying to stop a website in IIS using Stop-Webitem "somesite" command, when i run this in powershell command window it works fine, but when i try to call same file using jenkins powershell plugin i get the following exception
Stop-Webitem : Retrieving the COM class factory for component with CLSID
{688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error:
80040154 Class not registered (Exception from HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG)).
I googled and found that the issue is with the plugin invoking x86 version of powershell and registry problem, but could not find any solution on how to fix it. Any help is appreciated.