Add play-drug-wars.ps1

This commit is contained in:
Markus Fleschutz 2025-03-26 14:44:20 +01:00
parent 6f6886f88d
commit 17f8eea27f
2 changed files with 5388 additions and 5 deletions

View File

@ -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)"
}
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

File diff suppressed because it is too large Load Diff