Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

This will create a new PowerShell session and any existing objects will not be preserved. This may be required after updating or removing installed modules.

Code Block
languagepowershell
If ([System.Diagnostics.Process]::GetProcessesByName('servercoreshell')) { Exit } Else { $Process = [System.Diagnostics.Process]::GetCurrentProcess(); Start-Process -FilePath $Process.Path -ArgumentList ("-NoExit", "Stop-Process -Id $($Process.Id)") }