PowerShell utility cmdlets
Command | Synopsis |
---|---|
Find-Application | Shows in which folder the given (native) command resides |
Find-InFiles | Performs an (optionally recursive) file search based on a regular expression |
Find-UniqueFileName | Find-UniqueFileName [-Path] [[-MaxAttempts] ] [-CreateFile] [] |
Format-HashTable | Pretty-prints a (nested) hash table |
Format-Object | Pretty-prints a (nested) object |
Get-CommandInSameModule | Gets a list of commands that live in the same module as the given command. |
Get-ContiguousRange | Returns the first item or all items of the first contiguous range of items of the specified length |
Get-DropboxPath | Get-DropboxPath |
Get-FormattedText | Get-FormattedText [[-Text] <string[]>] [-BackgroundColor ] [-ForegroundColor ] [-BackgroundBright] [-ForegroundBright] [-Negative] [-Underline] [] |
Get-FriendlyTypeName | Get-FriendlyTypeName [-Type] <type[]> [-NullableFormat ] [-GenericFormat ] [-ArrayFormat ] [] |
Get-PropertyValueOrDefault | Get-PropertyValueOrDefault [-PropertyName] [[-DefaultValue] ] -Object <Object[]> [] |
Get-ValueOrDefault | Returns the value that was passed in, or, if that value was null, blank, zero or empty, returns the specified default value. If value may refer to an undefined element in an array or hashtable, wrap $Value in a scriptblock to prevent premature evaluation. |
Set-BreakOnError | Sets a breakpoint that causes the debugger to break on the first run-time error |
Split-Collection | Splits a collection into chuncks of a given size |
Test-NullableType | Test-NullableType [-Type] [] |
Shows in which folder the given (native) command resides
Find-Application [-Command] <string> [<CommonParameters>]
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
Performs an (optionally recursive) file search based on a regular expression
Find-InFiles [-Pattern] <string> [-Path <Object>] [-Filter <string>] [-Recurse] [-Context <int[]>] [<CommonParameters>]
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
Required? false
Position? named
Default value $Pwd
Accept pipeline input? false
Accept wildcard characters? false
Required? false
Position? named
Default value *.*
Accept pipeline input? false
Accept wildcard characters? false
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
Required? false
Position? named
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
Find-UniqueFileName [-Path] [[-MaxAttempts] ] [-CreateFile] []
Find-UniqueFileName [-Path] <string> [[-MaxAttempts] <int>] [-CreateFile] [<CommonParameters>]
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Required? false
Position? 1
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Required? true
Position? 0
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Pretty-prints a (nested) hash table
Format-HashTable [-HashTable] <IDictionary[]> [[-Indentation] <int>] [<CommonParameters>]
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
Required? false
Position? 2
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
Pretty-prints a (nested) object
Format-Object [-Caption] <string> [-Value] <Object> [[-Indentation] <int>] [<CommonParameters>]
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
Required? false
Position? 3
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
Gets a list of commands that live in the same module as the given command.
Get-CommandInSameModule [-Name] <string> [<CommonParameters>]
The name of the command whose sibling commands should be displayed
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
Returns the first item or all items of the first contiguous range of items of the specified length
Get-ContiguousRange [-Items] <int[]> [[-RequiredLength] <int>] [-ReturnAll] [<CommonParameters>]
The items in which the contiguous range is to be found
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
The required number of contiguous items
Required? false
Position? 2
Default value 1
Accept pipeline input? false
Accept wildcard characters? false
If true, all contiguous items are returned; if false, only the first item in the range is returned
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
1..20 | ForEach-Object { Get-ContiguousRange -Items (1..9 + 25..35 + 50..90) -RequiredLength $_ }
Get-DropboxPath
Get-DropboxPath
Get-FormattedText [[-Text] <string[]>] [-BackgroundColor ] [-ForegroundColor ] [-BackgroundBright] [-ForegroundBright] [-Negative] [-Underline] []
Get-FormattedText [[-Text] <string[]>] [-BackgroundColor <string>] [-ForegroundColor <string>] [-BackgroundBright] [-ForegroundBright] [-Negative] [-Underline] [<CommonParameters>]
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Required? false
Position? 1
Accept pipeline input? true (ByValue)
Parameter set name (All)
Aliases None
Dynamic? false
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Get-FriendlyTypeName [-Type] <type[]> [-NullableFormat ] [-GenericFormat ] [-ArrayFormat ] []
Get-FriendlyTypeName [-Type] <type[]> [-NullableFormat <string>] [-GenericFormat <string>] [-ArrayFormat <string>] [<CommonParameters>]
- System.String
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Required? true
Position? 0
Accept pipeline input? true (ByValue)
Parameter set name (All)
Aliases None
Dynamic? false
Get-PropertyValueOrDefault [-PropertyName] [[-DefaultValue] ] -Object <Object[]> []
Get-PropertyValueOrDefault [-PropertyName] <string> [[-DefaultValue] <Object>] -Object <Object[]> [<CommonParameters>]
Required? false
Position? 1
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Required? true
Position? Named
Accept pipeline input? true (ByValue)
Parameter set name (All)
Aliases None
Dynamic? false
Required? true
Position? 0
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Returns the value that was passed in, or, if that value was null, blank, zero or empty, returns the specified default value.
If value may refer to an undefined element in an array or hashtable, wrap $Value in a scriptblock to prevent premature evaluation.
Get-ValueOrDefault [[-DefaultValue] <Object>] [-Value <Object>] [<CommonParameters>]
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
('A' | ?? B) -eq "A" # returns True
('' | ?? C) -eq 'C' # returns True
($null | ?? D) -eq 'D' # returns True
(1 | ?? 2) -eq 1 # returns True
(0 | ?? 3) -eq 3 # returns True
('A' -as [int] | ?? E) -eq 'E' # returns True
($false | ?? F) -eq 'F' # returns True
($true | ?? G) -eq $true # returns True
({ @()[3] } | ?? H) -eq 'H' # returns True
({ @{}.Foo.Baz} | ?? I) -eq 'I' #returns True
Sets a breakpoint that causes the debugger to break on the first run-time error
Set-BreakOnError
Splits a collection into chuncks of a given size
Split-Collection [-Collection] <psobject[]> [-ChunkSize] <int> [<CommonParameters>]
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
Required? true
Position? 2
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
$Collection = (65..90) | ForEach-Object { [char]$_ }
$Collection | Split-Collection -ChunkSize 3 | Select-Object -Skip 3 -First 1
$Collection = (65..90) | ForEach-Object { [char]$_ }
Split-Collection -Collection $Collection -ChunkSize 5 | Select-Object -Skip 3 -First 1
$EmptyCollection = @()
$EmptyCollection | Split-Collection -ChunkSize 2 | Measure-Object
Test-NullableType [-Type] []
Test-NullableType [-Type] <type> [<CommonParameters>]
- System.Boolean
Required? true
Position? 0
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false