PowerShell Module Commands: Unterschied zwischen den Versionen

Aus Wiki-WebPerfect
Wechseln zu: Navigation, Suche
K (Admin verschob die Seite Compare PowerShell Module Commands nach PowerShell Module Commands, ohne dabei eine Weiterleitung anzulegen)
Zeile 11: Zeile 11:
 
</source>
 
</source>
  
 +
 +
== Get the definition of a function from a PowerShell module ==
 +
<source lang="powershell">Get-Content function:\<FUNCTION_NAME> </source>
  
  

Version vom 24. Januar 2022, 11:27 Uhr

Example for Hyper-V Module 1.1 and 2.0.0.0

Import-Module Hyper-V -RequiredVersion 1.1
$HvM1 = Get-Command -Module Hyper-V
Remove-Module Hyper-V
 
Import-Module Hyper-V -RequiredVersion 2.0.0.0
$HvM2 = Get-Command -Module Hyper-V
 
Compare-Object $HvM1 $HvM2


Get the definition of a function from a PowerShell module

Get-Content function:\<FUNCTION_NAME>