Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows aliases for TargetOSName parameter re: issue 184 #187

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AtomicArtem
Copy link

There is a minor issue with ConfigMgr when specifying the script Arguments for the "Apply Drivers Dynamically" Task Sequence Step and specifying the new TargetOSName attribute. During the script execution, the " characters are not respected due to parameter expansion and during the TS execution, the script line ends with-TargetOSName Windows. See issue #184. Experienced this in my environment and added escape characters for this as a workaround but I think this is makes it easier.
I added a wider variety for parameter validation set: "Windows11", "Win11", "W11", "Windows10", "Win10", "W10" and ensured the Get-OSBuild switch cases support new parameter sets.
This way people can use more variations of the name without worrying too much about the semantics.

@TokenRing
Copy link

I think at least with the current way the code is written, this will cause problems with how lines 1381 and 1382 in the current 4.2.1 file, because all the driver packs are downloaded as "windows (10|11) (x86|x64)" and so using anything other than "windows 10" or "windows 11" exactly - not win10, w10, etc - will not match the currently downloaded driver packages as they've been named. Obviously this can be worked around but it would take a few other changes.

@TokenRing
Copy link

TokenRing commented Feb 6, 2023

Also, would you mind giving an example as to how you successfully used the escape characters (the ` character I assume?) to have this work in your environment?

-BareMetal -Endpoint "FQDN" -TargetOSName `"Windows 10`" -TargetOSVersion "21H2" or something else?

@bernd33-1
Copy link

I spend days with this issue and the solution was finaly ONE backtick :-) Infront of the space bevore the 10 make the backtick.
-DriverUpdate -Endpoint 'your-sccm-server.domain.local' -TargetOSName "Windows` 10" -OperationalMode 'Pilot'

-OperationalMode 'Pilot' is only if you deploy Pilot Drivers. If not delete this parameter.

A Idea: I've installed several times Modern Driver Management and I had never issues. But this time it was a pain. But this time I had german clients and the error messages in SMSTS.LOG was german:

C:_SMSTaskSequence\Packages\MAI00017\Invoke-CMApplyDriverPackage.ps1 : Das Argument f�r den Parameter "TargetOSName" RunPowerShellScript 01.07.2023 17:13:00 6932 (0x1B14)
kann nicht �berpr�ft werden. Das Argument "Windows" geh”rt nicht zu dem vom ValidateSet-Attribut angegebenen Satz RunPowerShellScript 01.07.2023 17:13:00 6932 (0x1B14)
"Windows 11;Windows 10". Geben Sie ein Argument an, das in dem Satz enthalten ist, und f�hren Sie dann den Befehl RunPowerShellScript 01.07.2023 17:13:00 6932 (0x1B14)
erneut aus. RunPowerShellScript 01.07.2023 17:13:00 6932 (0x1B14)
In Zeile:1 Zeichen:136 RunPowerShellScript 01.07.2023 17:13:00 6932 (0x1B14)

  • ... Update -Endpoint maier-sccm.maier.local -TargetOSName Windows 10 -Tar ... RunPowerShellScript 01.07.2023 17:13:00 6932 (0x1B14)
  •                                                       ~~~~~~~	RunPowerShellScript	01.07.2023 17:13:00	6932 (0x1B14)
    
    • CategoryInfo : InvalidData: (:) [Invoke-CMApplyDriverPackage.ps1], ParameterBindingValidationException RunPowerShellScript 01.07.2023 17:13:00 6932 (0x1B14)
    • FullyQualifiedErrorId : ParameterArgumentValidationError,Invoke-CMApplyDriverPackage.ps1 RunPowerShellScript 01.07.2023 17:13:00 6932 (0x1B14)

MAYBE: It is a language issue? Because a lot of people have no issues. With my german clients I had a lot of issues :-)

SADLY: You always get "The argument for paramater TargetOSName is invalid..." Or simply Exitcode 1 in the SCCMLOG. So check everything twice...

In General: Pleas please pleas... Change this anoying Windows 10 to Win10 or Windows10 or 10 but pleas.... remove this Windows 10. It's a pain for all.

Regards, Bernd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants