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
rikulsilva
(Henrique Lima da Silva)
March 31, 2023, 4:29am
2
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?
rikulsilva
(Henrique Lima da Silva)
March 31, 2023, 3:49pm
4
Can you share your new powershell code ?