question

JayneThompson-5285 avatar image
0 Votes"
JayneThompson-5285 asked JayneThompson-5285 commented

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)

windows-10-setup
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JayneThompson-5285 avatar image
0 Votes"
JayneThompson-5285 answered

When I run the command manually from elevated PS this works as expected.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered JayneThompson-5285 commented

Hi JayneThompson-5285,

This command should be run from an elevated Powershell. Please try the following guide:

https://docs.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--

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This is being run via a Task Sequence so it is running under sccm account.

0 Votes 0 ·