All sorts of Verbose output could (probably should) be added to this to make it chattier, but, I just needed a quick utility function and this does the trick.function Create-FSOIfNotExists{param([ValidateNotNullOrEmpty()]$path,[ValidateSet(Directory,File)]$itemtype)if(-not(Test-Path -Path $path)){New-Item -Path $path -ItemType $itemtype |Out-Null;}}
PowerShell v2 Function CreateFSOIfNotExists
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment