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 Test-FileHash { | |
[CmdletBinding()] | |
[OutputType([bool])] | |
param ( | |
[Parameter(Mandatory, ParameterSetName = 'Path', | |
Position = 0, ValueFromPipeline, ValueFromPipelineByPropertyName)] | |
[ValidateNotNullOrEmpty()] | |
[ValidateScript({ [System.IO.File]::Exists($_) })] | |
[Alias('FullName')] | |
[string]$Path, |
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 ConvertFrom-RomanNumber { | |
[CmdletBinding()] | |
[OutputType([int])] | |
param ( | |
# | |
[Parameter(Mandatory,ValueFromPipeline,Position=0)] | |
[ValidatePattern('^[ivxlcdmIVXLCDM]+$')] | |
[string]$InputObject | |
) | |
begin { |
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}} | |
} |
NewerOlder