Working with PowerShell Modules, Parameters, Variable, Objects, Commands Script and Syntax.
Working with PowerShell Modules, Parameters, Variable, Objects,
Commands Script and Syntax running on WS2K19 by VMware Workstation.
Check the current PowerShell version table in this Windows Server is 5.1
This is done by utilizing a Command "Import-Module -Name".
Import-Module has various parameters are available.
We can see by click through them, there are a few simple ones:
First ones is "-Global" which will import it globally.
and add prefix to the names of actual command that will import it.
How do you know the names of the Modules.
We can use a command "Get-Module"
and actually has a property name "-ListAvailable" and press enter.
This one takes you to the PowerShell Core and look inside to the list of modules are available.
We have the name to the ones which we wish to import in.
"Get-Module -ListAvailable | Import-Module"
We can basically go back and tab through them by entering to every single module.
Get-Help
Now I just to utilize the "Get-Help Format-Table OR ft" commands
so it's returns back to the same value
"Get-Help -Name Format-Table"
"Format-Table -?"
"Help Format-Table" It gives a expanded help information
"Man Format-Table"
"Get-Help Format-Table -Detailed"
-Full
-Examples
-Online
-Parameter *
If I try a different function "Get-Help Get-ChildItem -Parameter *"
[Same principle applies to that specific function]
-Parameter GroupBy
[It's just return the detailed to that specific function]
Get-Help about_*
if we need too and it can ask you for a specific path.
$modulename = "PSDiagnostics"
$module = Invoke-Command -ScriptBlock { Get-Module -Name $modulename -ListAvailable }
$module
Get-Command | Format-Table
Get-Command Get-ChildItem
gcm Get-ChildItem
Get-Alias
Get-Command | Where-Object { $_.parametersets.count -gt 2 } | Format-List Name
gcm | ? { $_.parametersets.count -gt 2 } | fl Name
Write-Output "Test Message"
echo "Test Message"
$var1 = "Test Value 1"
$var1
Write-Host $var1
$var2 = Get-ComputerInfo [Loading]
Now create a Static Value from Get-Service
$var3 = "WSearch"
$var3
Get-Service -Name $var3
Get-Service | Sort-Object -Property Status
$env:SystemRoot
$env:DEMO = "My Text Value"
Get-ChildItem Env:
$varTest = "1"
$varTest
[int32]$varTest
[float]$varTest
[string]$varTest
[boolean]$varTest
Get-Service
Comments
Post a Comment