mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-31 23:45:48 +02:00
Updated cd-fonts.ps1 and cd-windows.ps1
This commit is contained in:
parent
19bcaa9e3d
commit
d60539608b
@ -5,7 +5,7 @@
|
|||||||
This PowerShell script changes the working directory to the fonts folder.
|
This PowerShell script changes the working directory to the fonts folder.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./cd-fonts
|
PS> ./cd-fonts
|
||||||
📂C:\Windows\Fonts (has 2 file and 3 subfolders)
|
📂C:\Windows\Fonts (has 12 fonts and 0 folders)
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -15,12 +15,12 @@
|
|||||||
try {
|
try {
|
||||||
$path = [Environment]::GetFolderPath('Fonts')
|
$path = [Environment]::GetFolderPath('Fonts')
|
||||||
if (-not(Test-Path "$path" -pathType container)) {
|
if (-not(Test-Path "$path" -pathType container)) {
|
||||||
throw "No fonts folder at 📂$path"
|
throw "No fonts folder at: $path"
|
||||||
}
|
}
|
||||||
Set-Location "$path"
|
Set-Location "$path"
|
||||||
$files = Get-ChildItem $path -attributes !Directory
|
$files = Get-ChildItem $path -attributes !Directory
|
||||||
$folders = Get-ChildItem $path -attributes Directory
|
$folders = Get-ChildItem $path -attributes Directory
|
||||||
"📂$path entered (has $($files.Count) files and $($folders.Count) subfolders)"
|
"📂$path entered (has $($files.Count) fonts and $($folders.Count) folders)"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0])"
|
"⚠️ Error: $($Error[0])"
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
This PowerShell script changes the working directory to the Windows directory.
|
This PowerShell script changes the working directory to the Windows directory.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./cd-windows
|
PS> ./cd-windows
|
||||||
📂C:\Windows entered (has 7 files and 42 subfolders)
|
📂C:\Windows entered (has 7 files and 42 folders)
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -20,7 +20,7 @@ try {
|
|||||||
Set-Location "$path"
|
Set-Location "$path"
|
||||||
$files = Get-ChildItem $path -attributes !Directory
|
$files = Get-ChildItem $path -attributes !Directory
|
||||||
$folders = Get-ChildItem $path -attributes Directory
|
$folders = Get-ChildItem $path -attributes Directory
|
||||||
"📂$path entered (has $($files.Count) files and $($folders.Count) subfolders)"
|
"📂$path entered (has $($files.Count) files and $($folders.Count) folders)"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0])"
|
"⚠️ Error: $($Error[0])"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user