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;}}
Tuesday, January 3, 2017
PowerShell v2 Function CreateFSOIfNotExists
Posted by
karjana
,
at
12:09 AM
Subscribe to:
Post Comments (Atom)