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
Get-WmiObject -namespace rootmscluster -class mscluster_resourcegroup -computer $computer -Authentication PacketPrivacy|Add-Member -pass ScriptProperty Node {Get-WmiObject -namespace rootmscluster -computer $computer -Authentication PacketPrivacy -query "ASSOCIATORS OF {MSCluster_ResourceGroup.Name='$($this.name)'} WHERE AssocClass = MSCluster_NodeToActiveGroup"|Select -ExpandProperty Name}|Select @{Name="Group";Expression={$_.Name}},Node,@{Name="Status";Expression={if($_.State -eq 0){"Online"}else{"Offline"}}}|ft -autosize |
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 Trace-Route { | |
<# | |
.SYNOPSIS | |
Trace the route between source computer and a target machine. | |
.DESCRIPTION | |
Trace the route between source computer and a target machine. | |
.EXAMPLE | |
Trace-Route Computer01 | |
Perform trace route to Computer01 | |
.EXAMPLE |
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
# PowerShell wget | |
# Version 1.0 | |
[CmdletBinding()] | |
param( | |
[Parameter(ValueFromPipeline = $true, Mandatory = $true)] | |
$url, | |
$dest = (Get-Location).Path | |
) | |
if(!$url){break} |
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 New-DataTableFromSqlTable{ | |
<# | |
.SYNOPSIS | |
Create a new (empty) DataTable object based on a SQL Table. | |
.DESCRIPTION | |
Create a new (empty) DataTable object based on a SQL Table. | |
.PARAMETER DatabaseServer | |
The Hostname of the database server. |
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-FolderSize{ | |
<# | |
.SYNOPSIS | |
Get the total size of a folder. | |
.DESCRIPTION | |
Get the total size of a folder. | |
.PARAMETER Path | |
Path to target folder. |
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 ConvertTo-ScriptBlock{ | |
<# | |
.SYNOPSIS | |
Convert to ScriptBlock. | |
.DESCRIPTION | |
Convert input to ScriptBlock. | |
.EXAMPLE | |
Get-Content '.\scriptFile.ps1' -raw | ConvertTo-ScriptBlock |
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-ChildItemRecurse{ | |
<# | |
.SYNOPSIS | |
Wrapper for Get-ChildItem to be able to define how deep you want to search in a directory structure. | |
.DESCRIPTION | |
Wrapper for Get-ChildItem to be able to define how deep you want to search in a directory structure. | |
.PARAMETER Path | |
One or more paths you want to start searching from. Defaults to '.' (Current location). |
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 Out-ClipboardText { | |
[CmdletBinding()] | |
param ( | |
[Parameter(ValueFromPipeline,Mandatory, Position = 0)] | |
[string] $Text | |
) | |
Add-Type -AssemblyName 'PresentationCore' | |
[System.Windows.Clipboard]::SetText($Text) | |
} |
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-ClipboardText{ | |
Add-Type -AssemblyName 'PresentationCore' | |
Write-Output ([System.Windows.Clipboard]::GetText()) | |
} |
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-SpecialFolder { | |
param ([string]$Name) | |
foreach ($folder in (([Enum]::GetValues([System.Environment+SpecialFolder])) | Where-Object {$_ -like $Name})) { | |
Write-Output (,([PSCustomObject] @{ | |
Name = $folder.ToString() | |
Path = [System.Environment]::GetFolderPath($folder) | |
})) | |
} | |
} |
OlderNewer