Last active
October 24, 2024 21:15
-
-
Save rleap-m/131921faac560a6bf84703e168788240 to your computer and use it in GitHub Desktop.
Seeing how this $MyInvocation PowerShell thing works.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host "`$MyInvocationInvocationName value is [$($MyInvocation.InvocationName)]" | |
Write-Host "`$MyInvocation.Line value is [$($MyInvocation.Line)]" | |
Write-Host "`$MyInvocation.Line is null? [$($null -eq $MyInvocation.Line)]" | |
Write-Host "`$MyInvocation.Line is empty string? [$('' -eq $MyInvocation.Line)]" | |
Write-Host | |
if (-Not ($MyInvocation.InvocationName -eq '.' -or $MyInvocation.Line -eq '')) { | |
Write-Host "I'm gonna run the installer!" | |
} | |
else { | |
Write-Host "Not going to run the installer. :-(" | |
} | |
Write-Host |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment