Last active
March 18, 2020 23:16
-
-
Save authentical/8f6ec19d12c22f1658e360b77cba5838 to your computer and use it in GitHub Desktop.
Restarts explorer
This file contains hidden or 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
#brb | |
$rerun = 1 | |
while($rerun -eq 1){ | |
try{ | |
if(![string]::IsNullOrEmpty(($explorerProc = Get-Process explorer))){ | |
kill $explorerProc | |
try{ | |
if(![string]::IsNullOrEmpty(($explorerProc = Get-Process explorer))){ | |
echo "" | |
echo "Found explorer: $explorerProc" | |
echo "" | |
} | |
} | |
catch { | |
"explorer is not running." | |
explorer | |
} | |
} | |
} | |
catch { | |
"explorer is not running according to Get-Process explorer" | |
} | |
try{ | |
if(![string]::IsNullOrEmpty(($explorerProc = Get-Process explorer))){ | |
echo "" | |
echo "Found explorer: $explorerProc" | |
echo "" | |
} | |
} | |
catch { | |
"explorer is not running." | |
explorer | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment