Add-ProvisioningPackage -path in Task Sequence is failing

Jayne Thompson 1 Reputation point
2022-05-16T01:23:39.497+00:00

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
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,899 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jayne Thompson 1 Reputation point
    2022-05-17T00:24:44.32+00:00

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

    0 comments No comments

  2. Limitless Technology 39,351 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--