Snap-Ins

Anmerkung zu Snap-Ins bzw. PSSnapins:

  • In PowerShell 1.0 der einzige Weg zusätzliche „Funktionen“ hinzuzufügen.

  • Snap-Ins müssen per Installation in das Windows System administrative integriert/installiert werden:

HKEY_LOCAL_MACHINE\Software\Microsoft\PowerShell\1\PowerShellSnapIns.
  • Übersicht über PSSnapins mit: Get-PSSnapin –Registered

  • Nachladen von Snap-Ins mit: Add-PSSnapin

Conclusio für eigene Erweiterungen rund um die PowerShell:
obsolete Technik, aber manchmal noch als $-SW in Firmen vorhanden!

Und man findet ja auch noch Snapin-Technik:

Get-PSSnapin -Name Microsoft.Powershell.Core
# oder auch nur
Get-PSSnapin

Name        : Microsoft.PowerShell.Core
PSVersion   : 5.1.19041.610
Description : Dieses Windows PowerShell-Snap-In enthält Cmdlets zum Verwalten von Windows PowerShell-Komponenten.

Get-PSSnapin -Name Microsoft.powershell.core | Select-Object *


Name                        : Microsoft.PowerShell.Core
IsDefault                   : True
ApplicationBase             : C:\Windows\System32\WindowsPowerShell\v1.0
AssemblyName                : System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL
ModuleName                  : C:\Windows\System32\WindowsPowerShell\v1.0\System.Management.Automation.dll
PSVersion                   : 5.1.19041.610
Version                     : 3.0.0.0
Types                       : {types.ps1xml, typesv3.ps1xml}
Formats                     : {Certificate.format.ps1xml, DotNetTypes.format.ps1xml, FileSystem.format.ps1xml, Help.format.ps1xml...}
Description                 : Dieses Windows PowerShell-Snap-In enthält Cmdlets zum Verwalten von Windows PowerShell-Komponenten.
Vendor                      : Microsoft Corporation
LogPipelineExecutionDetails : False

Das heißt zum Zeitpunkt dieser Tests (2020) steckt noch Kerntechnik in Form eines Snapins (und einer Windows-DLL) in der PowerShell: C:\Windows\System32\WindowsPowerShell\v1.0\System.Management.Automation.dll