Sunday, August 7, 2016

PowerShell v2 Function Show HiddenFolder

,
As a corollary to my Hide-Folder function this simply switches a folder items Attibutes to Directory.
function Show-HiddenFolder
{
      param(
            $foldername
      )
     
      if((Test-Path $foldername) -and ((Get-Item $folderName).PSIsContainer))
      {
            $(Get-Item $foldername -Force).Attributes = Directory
      }
      else
      {
            Write-Error "The folder ($($foldername)) was not found."
      }
}
I am sure there are a hundred better ways to do this, but, this is what I came up with for a quick fix.

0 comments to “PowerShell v2 Function Show HiddenFolder”

Post a Comment

 

Computer Info Copyright © 2016 -- Powered by Blogger