The Path
, Definition
, and Source
members of $MyInvocation.MyCommand
are all identical. Is this always the case? Under what conditions would the be different? What is the purpose of each?
The ScriptBlock
and ScriptContents
members are identical. What is the purpose of each?
PS C:srct> cat .Do-InvocationSettings.ps1
$MyInvocation.MyCommand | Format-List * -Force
return 0
PS C:srct> .Do-InvocationSettings.ps1
HelpUri :
Path : C:srctDo-InvocationSettings.ps1
Definition : C:srctDo-InvocationSettings.ps1
Source : C:srctDo-InvocationSettings.ps1
Visibility : Public
ScriptBlock : $MyInvocation.MyCommand | Format-List * -Force
return 0
OutputType : {}
ScriptContents : $MyInvocation.MyCommand | Format-List * -Force
return 0
OriginalEncoding : System.Text.UTF8Encoding+UTF8EncodingSealed
Name : Do-InvocationSettings.ps1
CommandType : ExternalScript
Version :
ModuleName :
Module :
RemotingCapability : PowerShell
Parameters : {}
ParameterSets : {}
My apologies for including a picture. Why does VS Code only display four (4) of the members of $MyInvocation.MyCommand
?