Functions/Show-FileExtensions.ps1
|
function Show-FileExtensions { <# .Notes AUTHOR: Skyler Hart CREATED: 02/08/2018 21:41:37 LASTEDIT: 02/08/2018 21:41:37 KEYWORDS: REQUIRES: #Requires -Version 3.0 #Requires -Modules ActiveDirectory #Requires -PSSnapin Microsoft.Exchange.Management.PowerShell.Admin #Requires -RunAsAdministrator .LINK https://wanderingstag.github.io #> [Diagnostics.CodeAnalysis.SuppressMessageAttribute( "PSUseSingularNouns", "", Justification = "Expresses exactly what the function does." )] [CmdletBinding()] Param ( [Switch]$Yes, [Switch]$No ) if ($Yes) {Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideFileExt -Type DWord -Value 0 -Force} elseif ($No) {Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideFileExt -Type DWord -Value 1 -Force} else {Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideFileExt -Type DWord -Value 0 -Force} } |