When I run the command manually from elevated PS this works as expected.
Add-ProvisioningPackage -path in Task Sequence is failing
Task Sequence was working fine with the following line
Add-provisioningPackage -path PathTo.PKG -forceinstall -QuietInstall
Now getting the below error in the smsts.log
add-ProvisioningPackage : The term 'add-ProvisioningPackage' is not recognized as the name of a cmdlet, function, RunPowerShellScript 9/05/2022 6:59:02 PM 1532 (0x05FC)
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is RunPowerShellScript 9/05/2022 6:59:02 PM 1532 (0x05FC)
correct and try again. RunPowerShellScript 9/05/2022 6:59:02 PM 1532 (0x05FC)
At X:\windows\TEMP\SMSTSPowerShellScripts{00ECBB3E-636B-46B6-995E-44A30B567AEF}.PS1:1 char:1 RunPowerShellScript 9/05/2022 6:59:02 PM 1532 (0x05FC)
- add-ProvisioningPackage -Path "C:\temp\PostImageCheckFiles\May02-2022 ... RunPowerShellScript 9/05/2022 6:59:02 PM 1532 (0x05FC)
- ~~~~~~~~~~~~~~~~~~~~~~~ RunPowerShellScript 9/05/2022 6:59:02 PM 1532 (0x05FC)
- CategoryInfo : ObjectNotFound: (add-ProvisioningPackage:String) [], CommandNotFoundException RunPowerShellScript 9/05/2022 6:59:02 PM 1532 (0x05FC)
- FullyQualifiedErrorId : CommandNotFoundException RunPowerShellScript 9/05/2022 6:59:02 PM 1532 (0x05FC)
RunPowerShellScript 9/05/2022 6:59:02 PM 1532 (0x05FC)
2 answers
Sort by: Oldest
-
-
Limitless Technology 39,376 Reputation points
2022-05-23T07:28:14.52+00:00 Hi JayneThompson-5285,
This command should be run from an elevated Powershell. Please try the following guide:
https://learn.microsoft.com/en-us/powershell/module/provisioning/install-provisioningpackage
I hope this answers your question.
Thanks.
--If the reply is helpful, please Upvote and Accept as answer--