Updated new-dir.ps1

This commit is contained in:
Markus Fleschutz 2024-05-06 18:05:37 +02:00
parent 598adae9cb
commit fa37a97c92

View File

@ -6,8 +6,8 @@
.PARAMETER path .PARAMETER path
Specifies the path and filename of the new directory Specifies the path and filename of the new directory
.EXAMPLE .EXAMPLE
PS> ./new-dir.ps1 Joe PS> ./new-dir.ps1 MyCollection
New directory 'Joe' created. New 📂C:\Temp\MyCollection created.
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -24,7 +24,7 @@ try {
$null = (New-Item -itemType directory -path $path) $null = (New-Item -itemType directory -path $path)
$path = Resolve-Path $path $path = Resolve-Path $path
"✔️ New directory 📂$path created." "✔️ New 📂$path created."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"