Is it possible to know if a PowerShell script is launched from GUI e.g. double-click in the explorer or manually in a powershell console?
I would like to use an interactive console mode if it's launched in GUI / explorer.
Is it possible to know if a PowerShell script is launched from GUI e.g. double-click in the explorer or manually in a powershell console?
I would like to use an interactive console mode if it's launched in GUI / explorer.
Query $host
automatic variable
$host.name
return the name of the actual host.