I have a PS script to monitor a logging file for a specific list of servers in the network. If the script logic finds the issue I'm monitoring for, I want to interrupt the script process with a launch and wait of windows explorer for the related server network folder path.
Windows explorer does show the requested folder, however PS doesn't wait for it to close.
This is the script I'm testing with:
# Sample networkfolderpath
$networkfolderpath = '\\server\d$\parent\child'
Start-Process explorer.exe -ArgumentList $networkfolderpath -Wait
FYI: I have a RDP function that is setup the same way and it does wait as expected.
Start-Process mstsc /v:$computername -Wait
I'm presuming at this point that windows explorer just behaves differently than some other exe.
What am I missing?