Open33
Powershell Tips (for cmdlet)
Command, Alias, Member
- To explore powershell cmdlet
help
alias | out-string -stream | select-string "gcm"
Get-Command
gm
Alias | Verb | Noun | Cmdlet | Description |
---|---|---|---|---|
man | help | help | man -> help | |
epal | Export | Alias | Export-Alias | epal -> Export-Alias |
gal | Get | Alias | Get-Alias | gal -> Get-Alias |
ipal | Import | Alias | Import-Alias | ipal -> Import-Alias |
nal | New | Alias | New-Alias | nal -> New-Alias |
sal | Set | Alias | Set-Alias | sal -> Set-Alias |
gcm | Get | Command | Get-Command | gcm -> Get-Command |
icm | Invoke | Command | Invoke-Command | icm -> Invoke-Command |
shcm | Show | Command | Show-Command | shcm -> Show-Command |
trcm | Trace | Command | Trace-Command | trcm -> Trace-Command |
gm | Get | Member | Get-Member | gm -> Get-Member |
Item
- To operate basic items
- FileInfo
- In drives
- Env:
- Variable:
- HKCU:
- HKLM:
-
dir
,ls
-
ni
==touch
-
del
,rm
rmdir
ren
-
cp
,mv
Alias | Verb | Noun | Cmdlet | Description |
---|---|---|---|---|
md | mkdir | mkdir | md -> mkdir | |
dir | Get | ChildItem | Get-ChildItem | dir -> Get-ChildItem |
ls | Get | ChildItem | Get-ChildItem | ls -> Get-ChildItem |
gci | Get | ChildItem | Get-ChildItem | gci -> Get-ChildItem |
gi | Get | Item | Get-Item | gi -> Get-Item |
si | Set | Item | Set-Item | si -> Set-Item |
ni | New | Item | New-Item | ni -> New-Item |
del | Remove | Item | Remove-Item | del -> Remove-Item |
erase | Remove | Item | Remove-Item | erase -> Remove-Item |
rd | Remove | Item | Remove-Item | rd -> Remove-Item |
ri | Remove | Item | Remove-Item | ri -> Remove-Item |
rm | Remove | Item | Remove-Item | rm -> Remove-Item |
rmdir | Remove | Item | Remove-Item | rmdir -> Remove-Item |
ren | Rename | Item | Rename-Item | ren -> Rename-Item |
rni | Rename | Item | Rename-Item | rni -> Rename-Item |
copy | Copy | Item | Copy-Item | copy -> Copy-Item |
cp | Copy | Item | Copy-Item | cp -> Copy-Item |
cpi | Copy | Item | Copy-Item | cpi -> Copy-Item |
mi | Move | Item | Move-Item | mi -> Move-Item |
move | Move | Item | Move-Item | move -> Move-Item |
mv | Move | Item | Move-Item | mv -> Move-Item |
cli | Clear | Item | Clear-Item | cli -> Clear-Item |
ii | Invoke | Item | Invoke-Item | ii -> Invoke-Item |
alias | oss | sls "command"
PS C:\Users\sakai> alias | oss | sls "command"
CommandType Name Version Source
Alias gcm -> Get-Command
Alias icm -> Invoke-Command
Alias shcm -> Show-Command
PSProvider - PSDrive
- PSProviders determine which data stores you can navigate through.
Drive | Provider | Root |
---|---|---|
C | FileSystem | C:\ |
D | FileSystem | D:\ |
G | FileSystem | G:\ |
Variable | Variable | |
Env | Environment | |
HKCU | Registry | |
HKLM | Registry | |
Alias | Alias | |
Cert | Certificate | \ |
Function | Function | |
WSMan | WSMan |
content
-
cat
,type
Alias | Verb | Noun | Cmdlet | Description |
---|---|---|---|---|
cat | Get | Content | Get-Content | cat -> Get-Content |
type | Get | Content | Get-Content | type -> Get-Content |
gc | Get | Content | Get-Content | gc -> Get-Content |
sc | Set | Content | Set-Content | sc -> Set-Content |
ac | Add | Content | Add-Content | ac -> Add-Content |
clc | Clear | Content | Clear-Content | clc -> Clear-Content |
location
pwd
cd
Alias | Verb | Noun | Cmdlet | Description |
---|---|---|---|---|
pwd | Get | Location | Get-Location | pwd -> Get-Location |
gl | Get | Location | Get-Location | gl -> Get-Location |
cd | Set | Location | Set-Location | cd -> Set-Location |
chdir | Set | Location | Set-Location | chdir -> Set-Location |
sl | Set | Location | Set-Location | sl -> Set-Location |
popd | Pop | Location | Pop-Location | popd -> Pop-Location |
pushd | Push | Location | Push-Location | pushd -> Push-Location |
cvpa | Convert | Path | Convert-Path | cvpa -> Convert-Path |
rvpa | Resolve | Path | Resolve-Path | rvpa -> Resolve-Path |
host, output, history
echo
cls
Alias | Verb | Noun | Cmdlet | Description |
---|---|---|---|---|
clear | Clear | Host | Clear-Host | clear -> Clear-Host |
cls | Clear | Host | Clear-Host | cls -> Clear-Host |
oh | Out | Host | Out-Host | oh -> Out-Host |
echo | Write | Output | Write-Output | echo -> Write-Output |
write | Write | Output | Write-Output | write -> Write-Output |
sleep | Start | Sleep | Start-Sleep | sleep -> Start-Sleep |
ghy | Get | History | Get-History | ghy -> Get-History |
h | Get | History | Get-History | h -> Get-History |
history | Get | History | Get-History | history -> Get-History |
ihy | Invoke | History | Invoke-History | ihy -> Invoke-History |
r | Invoke | History | Invoke-History | r -> Invoke-History |
iex | Invoke | Expression | Invoke-Expression | iex -> Invoke-Expression |
Format, Grep
Alias | Verb | Noun | Cmdlet | Description |
---|---|---|---|---|
fl | Format | List | Format-List | fl -> Format-List |
ft | Format | Table | Format-Table | ft -> Format-Table |
fw | Format | Wide | Format-Wide | fw -> Format-Wide |
fc | Format | Custom | Format-Custom | fc -> Format-Custom |
ogv | Out | GridView | Out-GridView | ogv -> Out-GridView |
sls | Select | String | Select-String | sls -> Select-String |
cfs | ConvertFrom | String | ConvertFrom-String | CFS -> ConvertFrom-String |
Object
Alias | Verb | Noun | Cmdlet | Description |
---|---|---|---|---|
% | ForEach | Object | ForEach-Object | % -> ForEach-Object |
foreach | ForEach | Object | ForEach-Object | foreach -> ForEach-Object |
select | Select | Object | Select-Object | select -> Select-Object |
? | Where | Object | Where-Object | ? -> Where-Object |
where | Where | Object | Where-Object | where -> Where-Object |
group | Group | Object | Group-Object | group -> Group-Object |
sort | Sort | Object | Sort-Object | sort -> Sort-Object |
compare | Compare | Object | Compare-Object | compare -> Compare-Object |
diff | Compare | Object | Compare-Object | diff -> Compare-Object |
measure | Measure | Object | Measure-Object | measure -> Measure-Object |
tee | Tee | Object | Tee-Object | tee -> Tee-Object |
variable
set
Alias | Verb | Noun | Cmdlet | Description |
---|---|---|---|---|
clv | Clear | Variable | Clear-Variable | clv -> Clear-Variable |
gv | Get | Variable | Get-Variable | gv -> Get-Variable |
nv | New | Variable | New-Variable | nv -> New-Variable |
rv | Remove | Variable | Remove-Variable | rv -> Remove-Variable |
set | Set | Variable | Set-Variable | set -> Set-Variable |
sv | Set | Variable | Set-Variable | sv -> Set-Variable |
dir Variable:
PS C:\Users\sakai> dir Variable:
Name Value
---- -----
? True
^
$
args {}
ConfirmPreference High
DebugPreference SilentlyContinue
EnabledExperimentalFeatures {}
Error {}
ErrorActionPreference Continue
ErrorView ConciseView
ExecutionContext System.Management.Automation.EngineIntrinsics
false False
FormatEnumerationLimit 4
HOME C:\Users\sakai
Host System.Management.Automation.Internal.Host.InternalHost
InformationPreference SilentlyContinue
input System.Collections.ArrayList+ArrayListEnumeratorSimple
IsCoreCLR True
IsLinux False
IsMacOS False
IsWindows True
MaximumHistoryCount 4096
MyInvocation System.Management.Automation.InvocationInfo
NestedPromptLevel 0
null
OutputEncoding System.Text.UTF8Encoding
PID 2328
PROFILE G:\Users\sakai\OneDrive\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
ProgressPreference Continue
PSBoundParameters {}
PSCommandPath
PSCulture en-GB
PSDefaultParameterValues {}
PSEdition Core
PSEmailServer
PSHOME C:\Program Files\PowerShell\7
PSScriptRoot
PSSessionApplicationName wsman
PSSessionConfigurationName http://schemas.microsoft.com/powershell/Microsoft.PowerShell
PSSessionOption System.Management.Automation.Remoting.PSSessionOption
PSStyle System.Management.Automation.PSStyle
PSUICulture en-US
PSVersionTable {PSVersion, PSEdition, GitCommitId, OS…}
PWD C:\Users\sakai
ShellId Microsoft.PowerShell
StackTrace
true True
VerbosePreference SilentlyContinue
WarningPreference Continue
WhatIfPreference False
dir Env:
PS C:\Users\sakai> dir Env:
Name Value
---- -----
ALLUSERSPROFILE C:\ProgramData
APPDATA C:\Users\sakai\AppData\Roaming
ChocolateyInstall C:\ProgramData\chocolatey
ChocolateyLastPathUpdate 132970419145927292
ChocolateyToolsLocation C:\tools
CommonProgramFiles C:\Program Files\Common Files
CommonProgramFiles(x86) C:\Program Files (x86)\Common Files
CommonProgramW6432 C:\Program Files\Common Files
COMPUTERNAME DESKTOP-2RE0MH8
ComSpec C:\WINDOWS\system32\cmd.exe
DriverData C:\Windows\System32\Drivers\DriverData
GOPATH C:\Users\sakai\go
HOMEDRIVE C:
HOMEPATH \Users\sakai
JAVA_HOME C:\Program Files\Eclipse Adoptium\jdk-17.0.3.7-hotspot\
LOCALAPPDATA C:\Users\sakai\AppData\Local
LOGONSERVER \\DESKTOP-2RE0MH8
NUMBER_OF_PROCESSORS 4
NVM_HOME C:\Users\sakai\AppData\Roaming\nvm
NVM_SYMLINK C:\Program Files\nodejs
OneDrive G:\Users\sakai\OneDrive
OneDriveConsumer G:\Users\sakai\OneDrive
OS Windows_NT
Path C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin;C:\P…
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL
POWERSHELL_DISTRIBUTION_CHANN… MSI:Windows 10 Pro
PROCESSOR_ARCHITECTURE AMD64
PROCESSOR_IDENTIFIER Intel64 Family 6 Model 92 Stepping 10, GenuineIntel
PROCESSOR_LEVEL 6
PROCESSOR_REVISION 5c0a
ProgramData C:\ProgramData
ProgramFiles C:\Program Files
ProgramFiles(x86) C:\Program Files (x86)
ProgramW6432 C:\Program Files
PSModulePath G:\Users\sakai\OneDrive\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Module…
PUBLIC C:\Users\Public
SystemDrive C:
SystemRoot C:\WINDOWS
TEMP C:\Users\sakai\AppData\Local\Temp
TMP C:\Users\sakai\AppData\Local\Temp
USERDOMAIN DESKTOP-2RE0MH8
USERDOMAIN_ROAMINGPROFILE DESKTOP-2RE0MH8
USERNAME sakai
USERPROFILE C:\Users\sakai
windir C:\WINDOWS
WORKPLACE G:\workspace\pwsh-environment
WSLENV WT_SESSION::WT_PROFILE_ID
WT_PROFILE_ID {574e775e-4f2a-5b96-ac1e-a2962a402336}
WT_SESSION 03b0b600-fdb9-4bde-806e-a1d32d7c3cf4
dir Function:
-
cd..
,mkdir
,help
oss
PS C:\Users\sakai> dir Function:
CommandType Name Version Source
----------- ---- ------- ------
Function cd..
Function cd\
Function help
Function mkdir
Function oss
Function Clear-Host
Function Pause
Function prompt
Function PSConsoleHostReadLine 2.1.0 PSReadLine
Function TabExpansion2
Function A:
Function B:
Function C:
Function D:
Function E:
Function F:
Function G:
Function H:
Function I:
Function J:
Function K:
Function L:
Function M:
Function N:
Function O:
Function P:
Function Q:
Function R:
Function S:
Function T:
Function U:
Function V:
Function W:
Function X:
Function Y:
Function Z:
web
curl
-
wget
- Each cmdlet is not similar with linux same commands.
Alias | Verb | Noun | Cmdlet | Description |
---|---|---|---|---|
irm | Invoke | RestMethod | Invoke-RestMethod | irm -> Invoke-RestMethod |
curl | Invoke | WebRequest | Invoke-WebRequest | curl -> Invoke-WebRequest |
iwr | Invoke | WebRequest | Invoke-WebRequest | iwr -> Invoke-WebRequest |
wget | Invoke | WebRequest | Invoke-WebRequest | wget -> Invoke-WebRequest |
clipboard
Alias | Verb | Noun | Cmdlet | Description |
---|---|---|---|---|
gcb | Get | Clipboard | Get-Clipboard | gcb -> Get-Clipboard |
scb | Set | Clipboard | Set-Clipboard | scb -> Set-Clipboard |
$PWD.Path | Set-Clipboard
PS C:\Users\sakai> $PWD.Path | Set-Clipboard
PS C:\Users\sakai> Get-Clipboard
C:\Users\sakai
$Env:Path -split ";" | oss | sls "go"
PS C:\Users\sakai> $Env:Path -split ";" | oss | sls Go
C:\Program Files\Go\bin
C:\Users\sakai\go\bin
(dir Alias:) | select -last 1 | gm -MemberType Property
PS C:\Users\sakai> (dir Alias:) | select -last 1 | gm -MemberType Property
TypeName: System.Management.Automation.AliasInfo Name MemberType Definition
---- ---------- ----------
CommandType Property System.Management.Automation.CommandTypes CommandType {get;}
Definition Property string Definition {get;}
Description Property string Description {get;set;}
Module Property psmoduleinfo Module {get;}
ModuleName Property string ModuleName {get;}
Name Property string Name {get;}
Options Property System.Management.Automation.ScopedItemOptions Options {get;set;}
OutputType Property System.Collections.ObjectModel.ReadOnlyCollection[System.Management.Automation.PSTypeNam…
Parameters Property System.Collections.Generic.Dictionary[string,System.Management.Automation.ParameterMetad…
ParameterSets Property System.Collections.ObjectModel.ReadOnlyCollection[System.Management.Automation.CommandPa…
ReferencedCommand Property System.Management.Automation.CommandInfo ReferencedCommand {get;}
RemotingCapability Property System.Management.Automation.RemotingCapability RemotingCapability {get;}
ResolvedCommand Property System.Management.Automation.CommandInfo ResolvedCommand {get;}
Source Property string Source {get;}
Version Property version Version {get;}
Visibility Property System.Management.Automation.SessionStateEntryVisibility Visibility {get;set;}
(dir Alias:) | select -last 1 | fl
PS C:\Users\sakai> (dir Alias:) | select -last 1 | fl
DisplayName : write -> Write-Output
CommandType : Alias
Definition : Write-Output
ReferencedCommand : Write-Output
ResolvedCommand : Write-Output
PS C:\Users\sakai> (dir Alias:) | select -last 1
CommandType Name Version Source
----------- ---- ------- ------
Alias write -> Write-Output
Powershell ISE
powershell ise
PS G:\workspace\pwsh-environment> dir
Directory: G:\workspace\pwsh-environment
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 07/06/2022 18:50 Copy-PomeraMemo
d----- 06/06/2022 17:56 Copy-Wgs50Images
d----- 29/06/2022 06:14 Get-Files
d----- 29/06/2022 07:11 temp
-a---- 02/06/2022 14:48 83 .replit
-a---- 07/06/2022 18:52 822 Copy-PomeraMemo.ps1
-a---- 07/06/2022 10:38 700 Copy-Wgs50images.ps1
-a---- 29/06/2022 14:35 767 Do-Array.ps1
-a---- 29/06/2022 14:55 956 Do-Hashtable.ps1
-a---- 06/06/2022 16:17 179 main.ps1
-a---- 03/06/2022 16:05 111 README.md
-a---- 02/06/2022 14:48 55 replit.nix
-a---- 21/06/2022 11:04 21 sample.md
PS G:\workspace\pwsh-environment> Get-ChildItem -File -Filter *.ps1
Directory: G:\workspace\pwsh-environment
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 07/06/2022 18:52 822 Copy-PomeraMemo.ps1
-a---- 07/06/2022 10:38 700 Copy-Wgs50images.ps1
-a---- 29/06/2022 14:35 767 Do-Array.ps1
-a---- 29/06/2022 14:55 956 Do-Hashtable.ps1
-a---- 06/06/2022 16:17 179 main.ps1
How Can I get the Object Type
PS C:\Users\sakai> (get-command get-member) | fl -Property *
HelpUri : https://go.microsoft.com/fwlink/?LinkID=2096704
DLL : C:\Program Files\PowerShell\7\Microsoft.PowerShell.Commands.Utility.dll
Verb : Get
Noun : Member
HelpFile : Microsoft.PowerShell.Commands.Utility.dll-Help.xml
PSSnapIn :
Version : 7.0.0.0
ImplementingType : Microsoft.PowerShell.Commands.GetMemberCommand
Definition :
Get-Member [[-Name] <string[]>] [-InputObject <psobject>] [-MemberType <PSMemberTypes>] [-View
<PSMemberViewTypes>] [-Static] [-Force] [<CommonParameters>]
DefaultParameterSet :
OutputType : {Microsoft.PowerShell.Commands.MemberDefinition}
Options : ReadOnly
Name : Get-Member
CommandType : Cmdlet
Source : Microsoft.PowerShell.Utility
Visibility : Public
ModuleName : Microsoft.PowerShell.Utility
Module : Microsoft.PowerShell.Utility
RemotingCapability : None
Parameters : {[InputObject, System.Management.Automation.ParameterMetadata], [Name,
System.Management.Automation.ParameterMetadata], [MemberType,
System.Management.Automation.ParameterMetadata], [View,
System.Management.Automation.ParameterMetadata]…}
ParameterSets : {[[-Name] <string[]>] [-InputObject <psobject>] [-MemberType <PSMemberTypes>] [-View
<PSMemberViewTypes>] [-Static] [-Force] [<CommonParameters>]}
PS C:\Users\sakai> (get-command get-member).GetType() | fl
IsCollectible : False
DeclaringMethod :
FullName : System.Management.Automation.CmdletInfo
AssemblyQualifiedName : System.Management.Automation.CmdletInfo, System.Management.Automation, Version=7.2.5.500,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
Namespace : System.Management.Automation
GUID : f0a2c562-679a-3e61-abb9-b53d23a175d7
GenericParameterAttributes :
IsSZArray : False
GenericParameterPosition :
ContainsGenericParameters : False
StructLayoutAttribute : System.Runtime.InteropServices.StructLayoutAttribute
Name : CmdletInfo
DeclaringType :
Assembly : System.Management.Automation, Version=7.2.5.500, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
BaseType : System.Management.Automation.CommandInfo
:
:
PS C:\Users\sakai> (get-command get-member).GetType().Fullname
System.Management.Automation.CmdletInfo
PS C:\Users\sakai> (alias)[-1].GetType().FullName
System.Management.Automation.AliasInfo
Confirm path setting
PS C:\Users\sakai> $EnV:Path -split ";" | oss | sls "Auto"
C:\Program Files\AutoHotkey\SciTE
C:\Program Files\AutoHotkey\v2
Confirm powershell profile path
PS C:\Users\sakai> Split-Path $PROFILE -Parent
C:\Users\sakai\OneDrive\Documents\PowerShell
Confirm the type of a variable
PS C:\Users\sakai> $PROFILE.GetType().Fullname
System.String
Item
dir variable: | oss | sls pre
PS C:\Users\sakai> dir variable: | oss | sls pre
ConfirmPreference High
DebugPreference SilentlyContinue
ErrorActionPreference Continue
InformationPreference SilentlyContinue
ProgressPreference Continue
VerbosePreference SilentlyContinue
WarningPreference Continue
WhatIfPreference False
dir variable: | oss | sls ps
PS C:\Users\sakai> dir variable: | oss | sls ps
PROFILE C:\Users\sakai\OneDrive\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
PSBoundParameters {}
PSCommandPath
PSCulture en-AU
PSDefaultParameterValues {}
PSEdition Core
PSEmailServer
PSHOME C:\Program Files\PowerShell\7
PSNativeCommandArgumentPassing Windows
PSScriptRoot
PSSessionApplicationName wsman
PSSessionConfigurationName http://schemas.microsoft.com/powershell/Microsoft.PowerShell
PSSessionOption System.Management.Automation.Remoting.PSSessionOption
PSStyle System.Management.Automation.PSStyle
PSUICulture en-US
PSVersionTable {[PSVersion, 7.3.6], [PSEdition, Core], [GitCommitId, 7.3.6], [OS, Microsoft Windows 10.0.22621]…}
.NET datatype Alias
[psobject].assembly.gettype("System.Management.Automation.TypeAccelerators")::Get
PS C:\Users\sakai> [psobject].assembly.gettype("System.Management.Automation.TypeAccelerators")::Get
Key Value
--- -----
Alias System.Management.Automation.AliasAttribute
AllowEmptyCollection System.Management.Automation.AllowEmptyCollectionAttribute
AllowEmptyString System.Management.Automation.AllowEmptyStringAttribute
AllowNull System.Management.Automation.AllowNullAttribute
ArgumentCompleter System.Management.Automation.ArgumentCompleterAttribute
ArgumentCompletions System.Management.Automation.ArgumentCompletionsAttribute
array System.Array
bool System.Boolean
byte System.Byte
char System.Char
CmdletBinding System.Management.Automation.CmdletBindingAttribute
datetime System.DateTime
decimal System.Decimal
double System.Double
DscResource System.Management.Automation.DscResourceAttribute
ExperimentAction System.Management.Automation.ExperimentAction
Experimental System.Management.Automation.ExperimentalAttribute
ExperimentalFeature System.Management.Automation.ExperimentalFeature
float System.Single
single System.Single
guid System.Guid
hashtable System.Collections.Hashtable
int System.Int32
int32 System.Int32
short System.Int16
int16 System.Int16
long System.Int64
int64 System.Int64
ciminstance Microsoft.Management.Infrastructure.CimInstance
cimclass Microsoft.Management.Infrastructure.CimClass
cimtype Microsoft.Management.Infrastructure.CimType
cimconverter Microsoft.Management.Infrastructure.CimConverter
IPEndpoint System.Net.IPEndPoint
NullString System.Management.Automation.Language.NullString
OutputType System.Management.Automation.OutputTypeAttribute
ObjectSecurity System.Security.AccessControl.ObjectSecurity
ordered System.Collections.Specialized.OrderedDictionary
Parameter System.Management.Automation.ParameterAttribute
PhysicalAddress System.Net.NetworkInformation.PhysicalAddress
pscredential System.Management.Automation.PSCredential
PSDefaultValue System.Management.Automation.PSDefaultValueAttribute
pslistmodifier System.Management.Automation.PSListModifier
psobject System.Management.Automation.PSObject
pscustomobject System.Management.Automation.PSObject
psprimitivedictionary System.Management.Automation.PSPrimitiveDictionary
ref System.Management.Automation.PSReference
PSTypeNameAttribute System.Management.Automation.PSTypeNameAttribute
regex System.Text.RegularExpressions.Regex
DscProperty System.Management.Automation.DscPropertyAttribute
sbyte System.SByte
string System.String
SupportsWildcards System.Management.Automation.SupportsWildcardsAttribute
switch System.Management.Automation.SwitchParameter
cultureinfo System.Globalization.CultureInfo
bigint System.Numerics.BigInteger
securestring System.Security.SecureString
timespan System.TimeSpan
ushort System.UInt16
uint16 System.UInt16
uint System.UInt32
uint32 System.UInt32
ulong System.UInt64
uint64 System.UInt64
uri System.Uri
ValidateCount System.Management.Automation.ValidateCountAttribute
ValidateDrive System.Management.Automation.ValidateDriveAttribute
ValidateLength System.Management.Automation.ValidateLengthAttribute
ValidateNotNull System.Management.Automation.ValidateNotNullAttribute
ValidateNotNullOrEmpty System.Management.Automation.ValidateNotNullOrEmptyAttribute
ValidatePattern System.Management.Automation.ValidatePatternAttribute
ValidateRange System.Management.Automation.ValidateRangeAttribute
ValidateScript System.Management.Automation.ValidateScriptAttribute
ValidateSet System.Management.Automation.ValidateSetAttribute
ValidateTrustedData System.Management.Automation.ValidateTrustedDataAttribute
ValidateUserDrive System.Management.Automation.ValidateUserDriveAttribute
version System.Version
void System.Void
ipaddress System.Net.IPAddress
DscLocalConfigurationManager System.Management.Automation.DscLocalConfigurationManagerAttribute
WildcardPattern System.Management.Automation.WildcardPattern
X509Certificate System.Security.Cryptography.X509Certificates.X509Certificate
X500DistinguishedName System.Security.Cryptography.X509Certificates.X500DistinguishedName
xml System.Xml.XmlDocument
CimSession Microsoft.Management.Infrastructure.CimSession
mailaddress System.Net.Mail.MailAddress
semver System.Management.Automation.SemanticVersion
adsi System.DirectoryServices.DirectoryEntry
adsisearcher System.DirectoryServices.DirectorySearcher
wmiclass System.Management.ManagementClass
wmi System.Management.ManagementObject
wmisearcher System.Management.ManagementObjectSearcher
scriptblock System.Management.Automation.ScriptBlock
pspropertyexpression Microsoft.PowerShell.Commands.PSPropertyExpression
psvariable System.Management.Automation.PSVariable
type System.Type
psmoduleinfo System.Management.Automation.PSModuleInfo
powershell System.Management.Automation.PowerShell
runspacefactory System.Management.Automation.Runspaces.RunspaceFactory
runspace System.Management.Automation.Runspaces.Runspace
initialsessionstate System.Management.Automation.Runspaces.InitialSessionState
psscriptmethod System.Management.Automation.PSScriptMethod
psscriptproperty System.Management.Automation.PSScriptProperty
psnoteproperty System.Management.Automation.PSNoteProperty
psaliasproperty System.Management.Automation.PSAliasProperty
psvariableproperty System.Management.Automation.PSVariableProperty
get-verb
PS G:\workspace\pwsh-libraries> get-verb | where {($_.Group -eq"Common")}
Verb AliasPrefix Group Description
---- ----------- ----- -----------
Add a Common Adds a resource to a container, or attaches an item to another item
Clear cl Common Removes all the resources from a container but does not delete the container
Close cs Common Changes the state of a resource to make it inaccessible, unavailable, or unusable
Copy cp Common Copies a resource to another name or to another container
Enter et Common Specifies an action that allows the user to move into a resource
Exit ex Common Sets the current environment or context to the most recently used context
Find fd Common Looks for an object in a container that is unknown, implied, optional, or specified
Format f Common Arranges objects in a specified form or layout
Get g Common Specifies an action that retrieves a resource
Hide h Common Makes a resource undetectable
Join j Common Combines resources into one resource
Lock lk Common Secures a resource
Move m Common Moves a resource from one location to another
New n Common Creates a resource
Open op Common Changes the state of a resource to make it accessible, available, or usable
Optimize om Common Increases the effectiveness of a resource
Push pu Common Adds an item to the top of a stack
Pop pop Common Removes an item from the top of a stack
Redo re Common Resets a resource to the state that was undone
Remove r Common Deletes a resource from a container
Rename rn Common Changes the name of a resource
Reset rs Common Sets a resource back to its original state
Resize rz Common Changes the size of a resource
Search sr Common Creates a reference to a resource in a container
Select sc Common Locates a resource in a container
Set s Common Replaces data on an existing resource or creates a resource that contains some data
Show sh Common Makes a resource visible to the user
Skip sk Common Bypasses one or more resources or points in a sequence
Split sl Common Separates parts of a resource
Step st Common Moves to the next point or resource in a sequence
Switch sw Common Specifies an action that alternates between two resources, such as to change between two locations, responsi…
Undo un Common Sets a resource to its previous state
Unlock uk Common Releases a resource that was locked
Watch wc Common Continually inspects or monitors a resource for changes
get list of static methods
PS G:\workspace\pwsh-libraries> [string] | get-member -MemberType Method -Static
TypeName: System.String
Name MemberType Definition
---- ---------- ----------
Compare Method static int Compare(string strA, string strB), static int Compare(string strA, string strB, bool ignoreCase…
CompareOrdinal Method static int CompareOrdinal(string strA, string strB), static int CompareOrdinal(string strA, int indexA, st…
Concat Method static string Concat(System.Object arg0), static string Concat(System.Object arg0, System.Object arg1), st…
Copy Method static string Copy(string str)
Create Method static string Create[TState](int length, TState state, System.Buffers.SpanAction[char,TState] action), sta…
Equals Method static bool Equals(string a, string b), static bool Equals(string a, string b, System.StringComparison com…
Format Method static string Format(string format, System.Object arg0), static string Format(string format, System.Object…
GetHashCode Method static int GetHashCode(System.ReadOnlySpan[char] value), static int GetHashCode(System.ReadOnlySpan[char] …
Intern Method static string Intern(string str)
IsInterned Method static string IsInterned(string str)
IsNullOrEmpty Method static bool IsNullOrEmpty(string value)
IsNullOrWhiteSpace Method static bool IsNullOrWhiteSpace(string value)
Join Method static string Join(char separator, Params string[] value), static string Join(string separator, Params str…
new Method string new(char[] value), string new(char[] value, int startIndex, int length), string new(System.Char*, S…
ReferenceEquals Method static bool ReferenceEquals(System.Object objA, System.Object objB)
noun list
PS G:\workspace\pwsh-libraries> gcm * -CommandType cmdlet | group noun -noelement | sort name
Count Name
----- ----
2 Acl
6 Alias
2 AppBackgroundTaskDiagnos…
1 AppBackgroundTaskResourc…
1 AppLockerFileInformation
4 AppLockerPolicy
3 AppProvisionedSharedPack…
4 AppSharedPackageContainer
2 AppxDefaultVolume
5 AppxPackage
3 AppxPackageAutoUpdateSet…
1 AppxPackageManifest
1 AppXProvisionedDataFile
3 AppxProvisionedPackage
1 AppxProvisionedPackages
5 AppxVolume
1 ArgumentCompleter
2 AuthenticodeSignature
1 BcdBootDefault
1 BcdBootDisplayOrder
1 BcdBootSequence
1 BcdBootTimeout
1 BcdBootToolsDisplayOrder
1 BcdDebugSettings
2 BcdElement
2 BcdElementBootDebug
2 BcdElementBootEms
2 BcdElementDebug
2 BcdElementEms
2 BcdElementEventLogging
2 BcdElementHypervisorDebug
4 BcdEntry
1 BcdEntryDebugSettings
1 BcdEntryHypervisorSettin…
1 BcdHypervisorSettings
4 BcdStore
2 BinaryMiLog
1 BitsFile
7 BitsTransfer
5 Certificate
2 CertificateAutoEnrollmen…
3 CertificateEnrollmentPol…
3 CertificateNotificationT…
1 ChildItem
1 CimAssociatedInstance
1 CimClass
1 CimIndicationEvent
4 CimInstance
1 CimMethod
3 CimSession
1 CimSessionOption
4 CIPolicy
2 CIPolicyIdInfo
1 CIPolicyInfo
3 CIPolicyRule
1 CIPolicySetting
1 CIPolicyVersion
2 Clipboard
2 Clixml
3 CmsMessage
5 Command
1 CommandInDesktopPackage
3 Computer
1 ComputerInfo
1 Connection
4 Content
3 Counter
1 Credential
4 Csv
2 Culture
1 Custom
1 DAPolicyChange
2 Date
1 Debug
1 Debugger
1 Default
1 DeliveryOptimizationLog
1 DeliveryOptimizationLogA…
1 DnsName
3 DscConfiguration
1 DscLocalConfigurationMan…
1 DscResource
3 DtcDiagnosticResourceMan…
5 DtcDiagnosticTransaction
1 EngineEvent
2 Error
5 Event
1 EventSubscriber
2 ExecutionPolicy
3 ExperimentalFeature
1 Expression
2 File
2 FileCatalog
1 FileHash
3 FormatData
1 GridView
1 Guid
3 Help
1 Hex
4 History
4 Host
1 HotFix
1 Html
1 HVCIOptions
1 Information
1 InstalledLanguage
9 Item
8 ItemProperty
1 ItemPropertyValue
7 Job
7 JobTrigger
3 Json
1 KdsCache
2 KdsConfiguration
3 KdsRootKey
2 Language
1 LapsADAuditing
1 LapsADComputerSelfPermis…
1 LapsADExtendedRights
1 LapsADPassword
1 LapsADPasswordExpiration…
1 LapsADReadPasswordPermis…
1 LapsADResetPasswordPermi…
1 LapsADSchema
1 LapsPassword
1 LapsPolicyProcessing
2 List
5 LocalGroup
3 LocalGroupMember
1 LocalizedData
7 LocalUser
4 Location
1 MailMessage
2 Markdown
2 MarkdownOption
2 Member
4 Module
2 ModuleManifest
1 ModuleMember
1 NetIPsecAuthProposal
1 NetIPsecMainModeCryptoPr…
1 NetIPsecQuickModeCryptoP…
2 NonRemovableAppsPolicy
1 Null
9 Object
1 ObjectEvent
1 OSUninstall
1 Output
5 Package
4 PackageProvider
4 PackageSource
5 Path
3 PfxCertificate
1 PfxData
3 PmemDedicatedMemory
3 PmemDisk
2 PmemPhysicalDevice
1 PmemUnusedRegion
1 PowerShellDataFile
1 Printer
5 Process
2 ProcessMitigation
1 ProcessMitigationPolicy
1 Progress
4 ProvisioningPackage
1 ProvisioningRepro
1 ProvisioningSession
5 PSBreakpoint
1 PSCallStack
1 PSDebug
3 PSDrive
1 PSEditor
2 PSHostProcess
1 PSHostProcessInfo
1 PSProvider
3 PSReadLineKeyHandler
2 PSReadLineOption
2 PSRemoting
1 PSRoleCapabilityFile
10 PSSession
1 PSSessionCapability
6 PSSessionConfiguration
2 PSSessionConfigurationFi…
1 PSSessionOption
1 PSTransportOption
1 PSWorkflowExecutionOption
1 Random
1 RecycleBin
1 RestMethod
1 RuleOption
2 Runspace
3 RunspaceDebug
6 ScheduledJob
3 ScheduledJobOption
1 SddlString
1 SecureBootPolicy
4 SecureBootUEFI
2 SecureString
1 SelfSignedCertificate
9 Service
1 SignerRule
1 Sleep
1 SoftwareInventory
2 StartLayout
1 StartLayoutEdgeAssets
1 StrictMode
3 String
1 StringData
1 SystemDriver
2 SystemPreferredUILanguage
1 Table
1 TemporaryFile
1 ThreadJob
1 TimeSpan
2 TimeZone
3 TlsCipherSuite
3 TlsEccCurve
4 TlsSessionTicketKey
4 Tpm
2 TpmAutoProvisioning
1 TpmEndorsementKeyInfo
3 TpmOwnerAuth
1 TpmSupportedFeature
1 Trace
2 TraceSource
2 Transcript
2 TroubleshootingPack
3 TrustedProvisioningCerti…
1 Type
3 TypeData
1 UICulture
1 Unique
1 Uptime
1 UserInternationalSetting…
5 Variable
1 Verb
1 Verbose
1 Warning
1 WebRequest
2 WheaMemoryPolicy
1 Wide
2 WIMBootEntry
2 WinAcceptLanguageFromLan…
2 WinCultureFromLanguageLi…
2 WinDefaultInputMethodOve…
3 WindowsCapability
1 WindowsCapabilitySource
1 WindowsCorruptMountPoint
1 WindowsCustomDataImage
1 WindowsCustomImage
2 WindowsDeveloperLicense
1 WindowsDeveloperLicenseR…
4 WindowsDriver
2 WindowsEdition
3 WindowsErrorReporting
12 WindowsImage
1 WindowsImageContent
3 WindowsOptionalFeature
3 WindowsPackage
1 WindowsProductKey
2 WindowsReservedStorageSt…
2 WindowsSearchSetting
1 WindowsUnattend
2 WinEvent
2 WinHomeLocation
2 WinLanguageBarOption
2 WinSystemLocale
2 WinUILanguageOverride
3 WinUserLanguageList
3 WSMan
1 WSManAction
3 WSManCredSSP
4 WSManInstance
1 WSManQuickConfig
1 WSManSessionOption
2 Xml
get-command -noun object
PS G:\workspace\pwsh-libraries> get-command -noun object
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Compare-Object 7.0.0.0 Microsoft.PowerShell.Utility
Cmdlet ForEach-Object 7.3.6.500 Microsoft.PowerShell.Core
Cmdlet Group-Object 7.0.0.0 Microsoft.PowerShell.Utility
Cmdlet Measure-Object 7.0.0.0 Microsoft.PowerShell.Utility
Cmdlet New-Object 7.0.0.0 Microsoft.PowerShell.Utility
Cmdlet Select-Object 7.0.0.0 Microsoft.PowerShell.Utility
Cmdlet Sort-Object 7.0.0.0 Microsoft.PowerShell.Utility
Cmdlet Tee-Object 7.0.0.0 Microsoft.PowerShell.Utility
Cmdlet Where-Object 7.3.6.500 Microsoft.PowerShell.Core
[environment]
PS G:\workspace\pwsh-libraries> [Environment] | gm -Type Method -static
TypeName: System.Environment
Name MemberType Definition
---- ---------- ----------
Equals Method static bool Equals(System.Object objA, System.Object objB)
Exit Method static void Exit(int exitCode)
ExpandEnvironmentVariables Method static string ExpandEnvironmentVariables(string name)
FailFast Method static void FailFast(string message), static void FailFast(string message, System.Exception except…
GetCommandLineArgs Method static string[] GetCommandLineArgs()
GetEnvironmentVariable Method static string GetEnvironmentVariable(string variable), static string GetEnvironmentVariable(string…
GetEnvironmentVariables Method static System.Collections.IDictionary GetEnvironmentVariables(System.EnvironmentVariableTarget tar…
GetFolderPath Method static string GetFolderPath(System.Environment+SpecialFolder folder), static string GetFolderPath(…
GetLogicalDrives Method static string[] GetLogicalDrives()
ReferenceEquals Method static bool ReferenceEquals(System.Object objA, System.Object objB)
SetEnvironmentVariable Method static void SetEnvironmentVariable(string variable, string value), static void SetEnvironmentVaria…
PS E:\> Get-Command -Type Cmdlet | Sort-Object -Property Noun | Where {$_.Noun -eq "Item"} | Format-Table -GroupBy Noun
Noun: Item
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Remove-Item 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Invoke-Item 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Copy-Item 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Rename-Item 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Clear-Item 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Get-Item 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet New-Item 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Set-Item 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Move-Item 7.0.0.0 Microsoft.PowerShell.Management