Last active
June 21, 2021 16:10
-
-
Save lukeawyatt/bebfbef75c6aa51c0c035c84fcf0f846 to your computer and use it in GitHub Desktop.
Shell: PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MODIFY TO YOUR SOURCE FILE EXTENSIONS | |
cd C:\projectdirectory | |
(dir -include *.cs,*.xaml -recurse | select-string .).Count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Pinghost ([ string] $Hostname ) | |
{ | |
$status=get-wmiobject win32_pingstatus -Filter "Address=' $Hostname'" | Select-Object statuscode | |
if($status .statuscode -eq 0) | |
{write-host $Hostname is REACHABLE -background "GREEN" -foreground "BLACk"} | |
else | |
{write-host $Hostname is NOT reachable -background "RED" -foreground "BLACk" } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(New-Object -COM Shell.Application).WindowsSecurity() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment