All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Login


All New Login

All gists matching topic PowerShell

Recently created
Least recently created
Recently updated
Least recently updated
michelgentile's Avatar

michelgentile / Housekeep folder

0 likes
0 forks
1 files
Last active 2 months ago
PowerShell
1 #Remove files older than...
2 Get-ChildItem -File -Recurse | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-180) } | Remove-Item -Force
3
4 #Remove empty folders (may be repeated up to X times...)
5 Get-ChildItem -Directory -Recurse | Where-Object { -not (Get-ChildItem -Path $_.FullName -Recurse -Force -ErrorAction SilentlyContinue) } | Remove-Item -Force
michelgentile's Avatar

michelgentile / Symbolic Link in Windows

0 likes
0 forks
1 files
Last active 1 month ago
PowerShell
1 pwsh -command "New-Item -ItemType SymbolicLink -Target 'c:\i\am\the\classic\folder' -Path 'c:\this\is\a\symbolic\link'"
michelgentile's Avatar

michelgentile / Compute Hash with PowerShell

0 likes
0 forks
1 files
Last active 6 months ago
PowerShell
1 pwsh -command "( Get-FileHash -Algorithm SHA256 c:\folder\file ).Hash.ToLower()"
Newer Older

Powered by Opengist ⋅ Load: 34ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文