-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.txt
34 lines (24 loc) · 890 Bytes
/
demo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#demo advanced function in PowerShell 7
# dot source the advanced-functions.ps1 file
help gs -full
Get-Server
cls
$cred = Get-Credential company\artd
New-Cimsession dom1,dom2,srv1,srv2,win10 -credential $cred
Get-Cimsession | Get-Server
## This uses a command, New-PSFormatXML, from the PSScriptTools module
## https://github.com/jdhitsolutions/PSScriptTools
Get-FormatView companyServerInfo
#using command aliases interactively is OK
gs thinkp1 -ProcessCount 10 | ft -view process
cls
## This uses a command from PSTypeExtensionTools
## https://github.com/jdhitsolutions/PSTypeExtensionTools
Get-PSTypeExtension companyServerInfo
Get-Server | Get-Member
cls
Get-Cimsession | get-server | sort os | ft -view os
#or do something else
Get-Cimsession | Get-Server | Select Computername,@{Name="FreeC";Expression = {$_.FreeDiskGB -as [int]}}
cls
# get-cimsession | remove-cimsession