Skip to content

Commit 3d31f68

Browse files
author
Markus Fleschutz
committed
Updated cd-users.ps1
1 parent 03d931f commit 3d31f68

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

scripts/cd-users.ps1

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<#
22
.SYNOPSIS
3-
Sets the working directory to the users directory
3+
Sets the working dir to the users directory
44
.DESCRIPTION
5-
This PowerShell script changes the working directory to the users directory.
5+
This PowerShell script sets the current working directory to the users directory.
66
.EXAMPLE
7-
PS> ./cd-users
8-
📂C:\Users entered (has 0 files and 4 subfolders)
7+
PS> ./cd-users.ps1
8+
📂C:\Users with 4 folders entered.
99
.LINK
1010
https://github.com/fleschutz/PowerShell
1111
.NOTES
@@ -15,12 +15,11 @@
1515
try {
1616
$path = Resolve-Path "~/.."
1717
if (-not(Test-Path "$path" -pathType container)) {
18-
throw "No users directory at $path"
18+
throw "No users directory at: $path"
1919
}
2020
Set-Location "$path"
21-
$files = Get-ChildItem $path -attributes !Directory
2221
$folders = Get-ChildItem $path -attributes Directory
23-
"📂$path entered (has $($files.Count) files and $($folders.Count) subfolders)"
22+
"📂$path with $($folders.Count) folders entered."
2423
exit 0 # success
2524
} catch {
2625
"⚠️ Error: $($Error[0])"

0 commit comments

Comments
 (0)