This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-Win32Service { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory,Position=0)] | |
[Alias('n')] | |
[string] | |
$Name, | |
[Parameter(Position=1)] | |
[ValidateSet('Name','Status','ExitCode','DesktopInteract','ErrorControl','PathName', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Simply displays a summary of the cmdlets and functions exported from the PowerShell module. | |
.DESCRIPTION | |
Simply displays a summary of the cmdlets and functions exported from the PowerShell module. | |
.EXAMPLE | |
PS C:\> Get-Module -Name 'Microsoft.PowerShell.Utility' | Show-PSModuleCommand | Format-Wide -GroupBy Verb -Column 6 | |
Displays a summary of the cmdlets and functions exported from the PowerShell module "Microsoft.PowerShell.Utility". | |
.INPUTS | |
[psmoduleinfo] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-TimeStampedFileName { | |
[CmdletBinding()] | |
[OutputType([System.IO.FileInfo])] | |
param ( | |
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName,Position=0)] | |
[Alias('FullName', 'p')] | |
[System.IO.FileInfo]$Path, | |
[Parameter(Position=1)] | |
[Alias('u', 'z')] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Script:styles = [System.Globalization.NumberStyles]::AllowHexSpecifier | |
$Script:formats = [cultureinfo]::InvariantCulture | |
function ConvertTo-CppHexVersion { | |
[CmdletBinding()] | |
[OutputType([string])] | |
param ( | |
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)] | |
[Alias('Version')] | |
[version] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Split-Array { | |
[CmdletBinding()] | |
param ( | |
[Parameter()] | |
[char[]] | |
$InputObject, | |
[Parameter()] | |
[int] | |
$PartSize | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-OldItem { | |
[CmdletBinding()] | |
[OutputType([System.IO.FileSystemInfo])] | |
param ( | |
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)] | |
[Alias('FullName')] | |
[System.IO.FileSystemInfo] | |
$Path, | |
[Parameter()] | |
[int] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 5.1 | |
class DotNetLocalizedStringFile { | |
[System.IO.FileInfo] | |
$SourceFile | |
[cultureinfo] | |
$CultureInfo | |
[System.IO.FileInfo] | |
$LocalizedFile | |
[bool] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This gist just explains values of IFormatProvider argument of the ToString() method of the .NET type System.Guid | |
# See more: https://learn.microsoft.com/ru-ru/dotnet/api/system.guid.tostring | |
enum PSGuidFormatProvider { | |
None = 0 # Only alphanumeric characters: 00000000000000000000000000000000 | |
Braces = 1 # Figure brackets, "{}": {00000000-0000-0000-0000-000000000000} | |
Dashes = 2 # Hyphens, "-": 00000000-0000-0000-0000-000000000000 | |
Parentheses = 3 # Round brackets, "()": (00000000-0000-0000-0000-000000000000) | |
Xadecimal = 4 # Groups of heXadecimal values: {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 5.1 | |
#Requires -Assembly "System.UriBuilder, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" | |
#Requires -Assembly "System.Web.HttpUtility, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" | |
<# | |
.SYNOPSIS | |
The function appends the username and password, both URL-encoded, to the specified URI. | |
.DESCRIPTION | |
The function appends the username and password, both URL-encoded, to the specified URI. | |
It can be useful for cases where you need to specify a username and password in an HTTP request, and either the username or the password or both contain special characters that need to be escaped. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 5.1 | |
<# | |
This PowerShell module contains a set of classes for comparing .NET objects that do not implement the IComparable interface, such as [System.Net.IPAddress], [System.Net.NetworkInformation.PhysicalAddress], [System.Security.Cryptography.Oid], [System.Uri]. | |
#> | |
enum PhysicalAddressCase { | |
Default = 0 | |
UpperCase = 1 | |
LowerCase = 2 |
NewerOlder