Browse Source

swithed to CIM for some cmdlets

pull/429/head
Dmitry Nefedov 2 years ago
parent
commit
ab45d1a9a7
  1. 2
      src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
  2. 2
      src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
  3. 2
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
  4. 6
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  5. 6
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

2
src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1

@ -64,7 +64,7 @@ function Checks
}
# Detect the OS build version
switch (((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -eq 17763) -and ((Get-WindowsEdition -Online).Edition -eq "EnterpriseS"))
switch (((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber -eq 17763) -and ((Get-WindowsEdition -Online).Edition -eq "EnterpriseS"))
{
$true
{

2
src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1

@ -64,7 +64,7 @@ function Checks
}
# Detect the OS build version
switch (((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -eq 19044) -and ((Get-WindowsEdition -Online).Edition -match "EnterpriseS"))
switch (((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber -eq 19044) -and ((Get-WindowsEdition -Online).Edition -match "EnterpriseS"))
{
$true
{

2
src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1

@ -64,7 +64,7 @@ function Checks
}
# Detect the OS build version
switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber)
{
{($_ -ge 19044) -and ($_ -le 19048)}
{

6
src/Sophia_Script_for_Windows_11/Module/Sophia.psm1

@ -56,7 +56,7 @@ function Checks
Get-ChildItem -Path $PSScriptRoot\..\ -File -Recurse -Force | Unblock-File
# Detect the OS build version
switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber)
{
{$_ -eq 22000}
{
@ -9278,7 +9278,7 @@ function StartLayout
$ShowMoreRecommendations
)
if ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -ge 22621)
if ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber -ge 22621)
{
switch ($PSCmdlet.ParameterSetName)
{
@ -12405,7 +12405,7 @@ function EditWithPhotosContext
$Show
)
if ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -le 22623)
if ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber -le 22623)
{
if (Get-AppxPackage -Name Microsoft.Windows.Photos)
{

6
src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

@ -56,7 +56,7 @@ function Checks
Get-ChildItem -Path $PSScriptRoot\..\ -File -Recurse -Force | Unblock-File
# Detect the OS build version
switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber)
{
{$_ -eq 22000}
{
@ -9296,7 +9296,7 @@ function StartLayout
$ShowMoreRecommendations
)
if ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -ge 22621)
if ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber -ge 22621)
{
switch ($PSCmdlet.ParameterSetName)
{
@ -12443,7 +12443,7 @@ function EditWithPhotosContext
$Show
)
if ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -le 22623)
if ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber -le 22623)
{
if (Get-AppxPackage -Name Microsoft.Windows.Photos)
{

Loading…
Cancel
Save