Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Determine if Running in PowerShell Console

$
0
0

Summary: Determine if you are running inside the Windows PowerShell console.

Hey, Scripting Guy! Question How can I find if I am running inside the Windows PowerShell console for my Windows PowerShell profile?

Hey, Scripting Guy! Answer Look at the $host.name property. If it returns ConsoleHost, you are running in the Windows PowerShell console.
           The following code shows how to do this:

if(($host.Name -match 'consolehost')) {$true}


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>