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)