jalopy67
jalopy67

Reputation: 79

How can I tell if whether my PowerShell module function was called by C# application or from the command line?

How can I tell if whether my PowerShell module function was called by my .NET / C# application (production) or from the command line (unit testing)? I'm running PowerShell v5, .NET 4.5.x .

Thanks!

Upvotes: 1

Views: 32

Answers (1)

jalopy67
jalopy67

Reputation: 79

$Host.Name shows me the name of the host application and allows me to distinguish between prod and test.

Upvotes: 1

Related Questions