ps/Modules/Cole.PowerShell.Developer/Public/New-Directory.ps1
2023-05-30 22:51:22 -07:00

25 lines
553 B
PowerShell

function New-Directory {
<#
.SYNOPSIS
This item creates a directory if it does not exist.
.PARAMETER FilePath
[string] The appropriate path
#>
[CmdletBinding()]
[OutputType([System.IO.FileInfo])]
param (
[Parameter(Mandatory = $true, Position = 0)]
[Alias('FileName')]
[Alias('File')]
[Alias('Name')]
[Alias('FilePath')]
[string]$Path
)
if (!(Test-Path $Path)) {
New-Item -Path $Path -ItemType Directory -Force
}
}
New-Alias -Name New-Folder -Value New-Directory