mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-30 13:44:43 +02:00
Add play-drug-wars.ps1
This commit is contained in:
parent
6f6886f88d
commit
17f8eea27f
@ -18,12 +18,14 @@ try {
|
||||
} else {
|
||||
$path = (New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path
|
||||
}
|
||||
if (Test-Path "$path" -pathType container) {
|
||||
Set-Location "$path"
|
||||
"📂$path"
|
||||
exit 0 # success
|
||||
if (-not(Test-Path "$path" -pathType container)) {
|
||||
throw "User's downloads folder at 📂$path doesn't exist (yet)"
|
||||
}
|
||||
throw "User's downloads folder at 📂$path doesn't exist (yet)"
|
||||
Set-Location "$path"
|
||||
$files = Get-ChildItem $path -attributes !Directory
|
||||
$folders = Get-ChildItem $path -attributes Directory
|
||||
"📂$path (has $($files.Count) files and $($folders.Count) folders)"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
|
5381
scripts/play-drug-wars.ps1
Normal file
5381
scripts/play-drug-wars.ps1
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user