Minggu, 07 Agustus 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.

lamsim

About lamsim

Author Description here.. Nulla sagittis convallis. Curabitur consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et, nibh. Duis vulputate elit in elit. Mauris dictum libero id justo.

Subscribe to this Blog via Email :