Killing an Internet Explorer process started by Powershell
dear all,
i using following code start ie process , navigate website.
$process = start-process "c:\program files (x86)\internet explorer\iexplore.exe" http://www.nu.nl -passthru
then want close process use
$process.kill()
this works beautifully when 1 internet explorer window open. if there internet explorer window open throw following error
exception calling "kill" "0" argument(s): "cannot process request because process has exited." @ line:2 char:1 + $process.kill() + ~~~~~~~~~~~~~~~ + categoryinfo : notspecified: (:) [], methodinvocationexception + fullyqualifiederrorid : invalidoperationexception
how can close internet explorer window opened powershell session?
thank you
$ie = new-object -com 'internetexplorer.application' $ie.visible = $true $ie.navigate("http://www.nu.nl") and close :
$ie.quit()
Windows Server > Windows PowerShell
Comments
Post a Comment