This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
script:powershell:os:command [2020/08/10 19:25] admin |
script:powershell:os:command [2021/07/05 11:04] (current) admin |
||
---|---|---|---|
Line 3: | Line 3: | ||
==== Récupérer le Release ID ==== | ==== Récupérer le Release ID ==== | ||
Récupérer l'information ReleaseID via une intérogration dans la base de registre de Windows 10, merci à [[https://nas.wuibaille.fr/wordpress/wiki/powershell-get-release-id-windows-10/|David]] pour cette trouvaille | Récupérer l'information ReleaseID via une intérogration dans la base de registre de Windows 10, merci à [[https://nas.wuibaille.fr/wordpress/wiki/powershell-get-release-id-windows-10/|David]] pour cette trouvaille | ||
- | <file PowerShell> | + | <sxh PowerShell> |
$ReleaseId = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId | $ReleaseId = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId | ||
$ReleaseId | $ReleaseId | ||
- | </file> | + | </sxh> |
Résultat :\\ | Résultat :\\ | ||
{{:script:powershell:os:2020-01-13_11_51_37-windows_powershell_ise.png?800|}} | {{:script:powershell:os:2020-01-13_11_51_37-windows_powershell_ise.png?800|}} | ||
==== Récupérer les informations de version sans passer par du WMI ==== | ==== Récupérer les informations de version sans passer par du WMI ==== | ||
- | <file PowerShell> | + | <sxh PowerShell> |
# Version Intégrale | # Version Intégrale | ||
([System.Environment]::OSVersion.Version).ToString() | ([System.Environment]::OSVersion.Version).ToString() | ||
Line 17: | Line 17: | ||
# Information Major | # Information Major | ||
([System.Environment]::OSVersion.Version.Major).ToString() | ([System.Environment]::OSVersion.Version.Major).ToString() | ||
- | </file> | + | </sxh> |
Résultat :\\ | Résultat :\\ | ||
{{:script:powershell:os:2020-01-13_11_53_17-windows_powershell_ise.png|}} | {{:script:powershell:os:2020-01-13_11_53_17-windows_powershell_ise.png|}} | ||
+ | ==== Convertir une build en Nom ==== | ||
+ | <sxh powershell> | ||
+ | [string]$Version = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ReleaseId | ||
+ | |||
+ | $Edition = switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) | ||
+ | { | ||
+ | 10240 { '1507' } | ||
+ | 10586 { '1511' } | ||
+ | 14393 { '1607' } | ||
+ | 15063 { '1703' } | ||
+ | 16299 { '1709' } | ||
+ | 17134 { '1803' } | ||
+ | 17763 { '1809' } | ||
+ | 18362 { '1903' } | ||
+ | 18363 { '1909' } | ||
+ | 19041 { '2004' } | ||
+ | 19042 { '20H2' } | ||
+ | 19043 { '21H1' } | ||
+ | 21390 { '21H2' } | ||
+ | default { 'Unknown' } | ||
+ | } | ||
+ | |||
+ | $Edition | ||
+ | </sxh> | ||
+ | |||
+ | |||
+ | ==== Ouvrir l'un des menus parametres de Windows 10 ==== | ||
+ | <sxh powershell> | ||
+ | & C:\Windows\System32\control.exe /name Microsoft.WindowsUpdate | ||
+ | </sxh> | ||
+ | |||
+ | ==== Récupérer les MUI installés ==== | ||
+ | <sxh powershell> | ||
+ | $Wmi_OS = Get-CimInstance -ClassName "Win32_OperatingSystem" -Namespace "root\CIMV2" | ||
+ | $GetMUILanguages = $Wmi_OS.MUILanguages | ||
+ | </sxh> |