MSEndpointMgr / ConfigMgr

Microsoft Endpoint Configuration Manager scripts and tools
637 stars 281 forks source link

"wrap an ampersand in double" DriverUpdate error #321

Closed Bearwhale closed 3 years ago

Bearwhale commented 3 years ago

Hey all!

Copied and pasted this from the SCCM subreddit, but here it is again. I was testing the DriverUpdate feature, but when I run the Task Sequence, I get a very odd error, Error Code 1. I can't find an ApplyDriverUpdate.log file either."

Here's the link to the Reddit thread to the pictures, I can't seem to attach them in here. https://www.reddit.com/r/SCCM/comments/n9f17q/modern_driver_management_wrap_an_ampersand_in/gxobn8z/?context=3

Here's what I'm seeing in the SMSTS log. I'm running it as Available on a test laptop, just two steps in the Task Sequence, as it is set up in the example. `<![LOG[Executing command line: Run PowerShell Script with options (0, 4)]LOG]!>

<![LOG[Process completed with exit code 1]LOG]!>

<![LOG[At C:_SMSTaskSequence\Packages\LV1000DF\Invoke-CMApplyDriverPackage.ps1:185 char:23]LOG]!>

<![LOG[+ Sign up]LOG]!>

<![LOG[+ ~]LOG]!>

<![LOG[The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double ]LOG]!>

<![LOG[quotation marks ("&") to pass it as part of a string.]LOG]!>

<![LOG[At C:_SMSTaskSequence\Packages\LV1000DF\Invoke-CMApplyDriverPackage.ps1:213 char:189]LOG]!>

<![LOG[+ ... ata-ga-click="(Logged out) Header, go to Features">Features <span cla ...]LOG]!>

<![LOG[+ ~]LOG]!>

<![LOG[The '<' operator is reserved for future use.]LOG]!>

<![LOG[At C:_SMSTaskSequence\Packages\LV1000DF\Invoke-CMApplyDriverPackage.ps1:213 char:269]LOG]!>

<![LOG[+ ... nk-symbol float-right text-normal color-text-tertiary pr-3">→</s ...]LOG]!>

<![LOG[+ ~]LOG]!>

<![LOG[The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double ]LOG]!>

<![LOG[quotation marks ("&") to pass it as part of a string.]LOG]!>

<![LOG[At C:_SMSTaskSequence\Packages\LV1000DF\Invoke-CMApplyDriverPackage.ps1:215 char:165]LOG]!>

<![LOG[+ ... ck Link--secondary no-underline f5 Bump-link--hover">Mobile <span cla ...]LOG]!>

<![LOG[+ ~]LOG]!>

<![LOG[The '<' operator is reserved for future use.]LOG]!>

<![LOG[At C:_SMSTaskSequence\Packages\LV1000DF\Invoke-CMApplyDriverPackage.ps1:215 char:245]LOG]!>

<![LOG[+ ... nk-symbol float-right text-normal color-text-tertiary pr-3">→</s ...]LOG]!>

<![LOG[+ ~]LOG]!>

<![LOG[The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double ]LOG]!>

<![LOG[quotation marks ("&") to pass it as part of a string.]LOG]!>

<![LOG[At C:_SMSTaskSequence\Packages\LV1000DF\Invoke-CMApplyDriverPackage.ps1:216 char:176]LOG]!>

<![LOG[+ ... k Link--secondary no-underline f5 Bump-link--hover">Actions <span cla ...]LOG]!>

<![LOG[+ ~]LOG]!>

<![LOG[The '<' operator is reserved for future use.]LOG]!>

<![LOG[At C:_SMSTaskSequence\Packages\LV1000DF\Invoke-CMApplyDriverPackage.ps1:216 char:256]LOG]!>

<![LOG[+ ... nk-symbol float-right text-normal color-text-tertiary pr-3">→</s ...]LOG]!>

<![LOG[+ ~]LOG]!>

<![LOG[The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double ]LOG]!>

<![LOG[quotation marks ("&") to pass it as part of a string.]LOG]!>

<![LOG[At C:_SMSTaskSequence\Packages\LV1000DF\Invoke-CMApplyDriverPackage.ps1:217 char:182]LOG]!>

<![LOG[+ ... ink--secondary no-underline f5 Bump-link--hover">Codespaces <span cla ...]LOG]!>

<![LOG[+ ~]LOG]!>

<![LOG[The '<' operator is reserved for future use.]LOG]!>

<![LOG[At C:_SMSTaskSequence\Packages\LV1000DF\Invoke-CMApplyDriverPackage.ps1:217 char:262]LOG]!>

<![LOG[+ ... nk-symbol float-right text-normal color-text-tertiary pr-3">→</s ...]LOG]!>

<![LOG[+ ~]LOG]!>

<![LOG[The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double ]LOG]!>

<![LOG[quotation marks ("&") to pass it as part of a string.]LOG]!>

<![LOG[At C:_SMSTaskSequence\Packages\LV1000DF\Invoke-CMApplyDriverPackage.ps1:218 char:178]LOG]!>

<![LOG[+ ... Link--secondary no-underline f5 Bump-link--hover">Packages <span cla ...]LOG]!>

<![LOG[+ ~]LOG]!>

<![LOG[The '<' operator is reserved for future use.]LOG]!>

<![LOG[Not all parse errors were reported. Correct the reported errors and try again.]LOG]!>

<![LOG[ + CategoryInfo : ParserError: (:) [], ParseException]LOG]!>

<![LOG[ + FullyQualifiedErrorId : AmpersandNotAllowed]LOG]!>

<![LOG[ ]LOG]!>

<![LOG[PowerShell command line returned code 1]LOG]!>

<![LOG[ReleaseSource() for C:_SMSTaskSequence\Packages\LV1000DF.]LOG]!>

<![LOG[reference count 1 for the source C:_SMSTaskSequence\Packages\LV1000DF before releasing]LOG]!>

<![LOG[Released the resolved source C:_SMSTaskSequence\Packages\LV1000DF]LOG]!>

<![LOG[Process completed with exit code 1]LOG]!>

<![LOG[!--------------------------------------------------------------------------------------------!]LOG]!>

<![LOG[Failed to run the action: Dynamically Apply Drivers. Error 1]LOG]!>

<![LOG[Not in SSL.]LOG]!>

<![LOG[Set a global environment variable _SMSTSLastActionRetCode=1]LOG]!>

<![LOG[Set a global environment variable _SMSTSLastActionName=Dynamically Apply Drivers]LOG]!>

<![LOG[Set a global environment variable _SMSTSLastActionSucceeded=false]LOG]!>

<![LOG[Clear local default environment]LOG]!>

<![LOG[Let the parent group (Modern Driver Management) decides whether to continue execution]LOG]!>

<![LOG[The execution of the group (Modern Driver Management) has failed and the execution has been aborted. An action failed. Error 0x80004004]LOG]!>

<![LOG[Failed to run the last action: Dynamically Apply Drivers. Result 1. Execution of task sequence failed.]LOG]!>

<![LOG[Not in SSL.]LOG]!>`

Bearwhale commented 3 years ago

Actually you can mark this one solved, I had to copy the lines of code from GitHub to the .ps1 file as it was saving some weird HTML in there.