Invoke Power Shell Activity fails

Hello Friends,

I am facing below issue while running Invoke Power shell activity

PS Script : $printer = Get-CimInstance -Class Win32_Printer -Filter “Name=‘Microsoft Print to PDF’”
Invoke-CimMethod -InputObject $printer -MethodName SetDefaultPrinter

included in ps1 file and provided input to Invoke Power shell activity

Can anyone please help here

Hi @Pramod_Mangale

Import the module before use it

Insert into first line in your script

Import-Module CimCmdlets

After adding that module, getting below error, is it like that Microsoft Print to PDF needs to be provided as parameter and should not be hardcoded in script?

Can you share your new powershell code ?