I have noticed around the forums and some replies I have gotten on some of my personal powershell issues that a command “Get-InstanceID” exists.
I tried using this cmdlet myself to no avail…I have read that this cmdlet was introduced in 3.0…yet I in fact have powershell 3.0.
It seems that my powershell doesn’t have this command!
I’m not familiar with the command, but most commands are not native to PowerShell. They are added in, usually as modules. That is almost always true when they relate to some external product. For example, Get-ADUser is not a native Windows PowerShell command; it comes with specific versions of the Windows operating system.
Oh, so you are creating the function with that code! Now I get it! I should of read the help on “function”. I should of known this!
Taken from the Learn Windows Powershell in a Month of Lunches book (second edition), page 38 Chapter 4
"A function can be similar to a cmdlet, but rather than being written in a .NET language, functions are written in PowerShell's own scripting language."