semantics
The rule to write the names of cmdlets in the form - suggests some semantic implications on the particular task: if we have the cmdlet
PS c:>get-psdrive
Name Provider Root
---- -------- ----
A FileSystem A:
Alias Alias
C FileSystem C:
cert Certificate
D FileSystem D:
E FileSystem E:
Env Environment
Function Function
HKCU Registry HKEY_CURRENT_USER
HKLM Registry HKEY_LOCAL_MACHINE
Variable Variable
this implies as set of tripels
< c > < is a > < FileSystem >
< env > < is a > < Environment >
< hklm > < is a > < Registry >
< alias > < is a > < Alias >
…
Such tripels are the basic structure in the data model of the Resource Description Framework. Every such statement as above is called a tripel.
My question is now if there any useful application of this interpretation of cmdlet semantics?
Also piping could make sense in this picture:
PS c:>get-process m*
might look like be
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
94 2 1032 1896 29 2,21 964 mdm
189 129 1940 2524 40 1,46 2944 mqsvc
118 3 1392 1428 34 0,25 3468 mqtgsvc
159 6 1888 1292 36 1,26 1132 msdtc
If we pipe this thru to the get-command mdlet
PS c:>get-process m* | get-command
this is
CommandType Name Definition
----------- ---- ----------
Application mdm.exe C:\WINDOWS\system32\mdm.exe
Application mqsvc.exe C:\WINDOWS\system32\mqsvc.exe
Application mqtgsvc.exe C:\WINDOWS\system32\mqtgsvc.exe
Application msdtc.exe C:\WINDOWS\system32\msdtc.exe
this implies a typical graph of resources
< handle : id=964 > < is a > < running process starting, name with m >
< handle : id=964 > < is the programm > < c :\WINDOWS\system32\mdm.exe >
Could it help to categorize items of the systems and relate them in such semantic graphs?
What is the difference to other shells ? They don’t have such a clear classification of commands (or cmdlets) in groups. In this case the result of
PS c:>get-command get-*
should be the typical representant for such < is a > statement generators. Or tripelified
< get-command get-* > < are > < "is a" generators >
(it’s late in the night, things getting weird, I should go to bed…
Further resources
Just as a presonel reminder another random collection of ´resources on powershell