Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit a9fa1d2

Browse files
committed
Apply coding style for Enable/DisableVerboseStatus
1 parent 3ded96e commit a9fa1d2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Win10.psm1

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,13 +1010,13 @@ Function EnableSharedExperiences {
10101010
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\CDP" -Name "RomeSdkChannelUserAuthzPolicy" -Type DWord -Value 1
10111011
}
10121012

1013-
# Enable Clipboard History - Applicable since 1809
1013+
# Enable Clipboard History - Applicable since 1809. Not applicable to Server
10141014
Function EnableClipboardHistory {
10151015
Write-Output "Enabling Clipboard History..."
10161016
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Clipboard" -Name "EnableClipboardHistory" -Type DWord -Value 1
10171017
}
10181018

1019-
# Disable Clipboard History - Applicable since 1809
1019+
# Disable Clipboard History - Applicable since 1809. Not applicable to Server
10201020
Function DisableClipboardHistory {
10211021
Write-Output "Disabling Clipboard History..."
10221022
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Clipboard" -Name "EnableClipboardHistory" -ErrorAction SilentlyContinue
@@ -1871,13 +1871,21 @@ Function EnableChangingSoundScheme {
18711871
# Enable verbose startup/shutdown status messages
18721872
Function EnableVerboseStatus {
18731873
Write-Output "Enabling verbose startup/shutdown status messages..."
1874-
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'VerboseStatus' -Value '1' -PropertyType DWORD -Force
1874+
If ((Get-CimInstance -Class "Win32_OperatingSystem").ProductType -eq 1) {
1875+
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "VerboseStatus" -Type DWord -Value 1
1876+
} Else {
1877+
Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "VerboseStatus" -ErrorAction SilentlyContinue
1878+
}
18751879
}
18761880

18771881
# Disable verbose startup/shutdown status messages
18781882
Function DisableVerboseStatus {
18791883
Write-Output "Disabling verbose startup/shutdown status messages..."
1880-
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'VerboseStatus' -Value '0' -PropertyType DWORD -Force
1884+
If ((Get-CimInstance -Class "Win32_OperatingSystem").ProductType -eq 1) {
1885+
Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "VerboseStatus" -ErrorAction SilentlyContinue
1886+
} Else {
1887+
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "VerboseStatus" -Type DWord -Value 0
1888+
}
18811889
}
18821890

18831891
# Disable F1 Help key in Explorer and on the Desktop

0 commit comments

Comments
 (0)