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 | |
Returns information about the Processor via WMI. | |
.DESCRIPTION | |
Information about the processor is returned using the Win32_Processor WMI class. | |
You can provide a single computer/server name or supply an array/list. | |
.PARAMETER Computers |
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
[cmdletbinding()] | |
param( | |
[parameter(mandatory=$true)] | |
[int]$NumHyperCores | |
) | |
$Log = "C:\CPUStressTest.ps1.log" | |
$StartDate = Get-Date | |
Write-Output "============= CPU Stress Test Started: $StartDate =============" >> $Log | |
Write-Output "Started By: $env:username" >> $Log |
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
[cmdletbinding(PositionalBinding = $true, | |
DefaultParameterSetName = "Default")] | |
param ( | |
[parameter(mandatory = $false, | |
ValueFromPipeline = $true, | |
ValueFromPipelineByPropertyName = $true, | |
Position = 0)] | |
[alias('Comp', 'Name', 'DNSHostName')] | |
[string[]]$ComputerName = 'localhost' | |
) |
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
<# | |
.DESCRIPTION | |
Load appropriate PowerCLI PSSnapins. These are based on PowerCLI 5.8 R1. | |
#> | |
[cmdletbinding()] | |
param() | |
PROCESS { | |
try { |
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
<# | |
A more complete function can be found in my PowerCLI 'prod' repo at: | |
https://github.com/vMotioned/PowerCLI/blob/master/Get-VMToolsBuildToVersionMapping.ps1 | |
#> | |
Invoke-RestMethod -Method Get -Uri 'http://packages.vmware.com/tools/versions' |
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 Set-ConsoleWindowTitle { | |
[cmdletbinding()] | |
param ( | |
[parameter(Mandatory = $true, | |
Position = 0, | |
ParameterSetName = 'Default')] | |
[validateset("Default", "Custom")] | |
[string]$MessageType, | |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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-OrderedVM { | |
[cmdletbinding()] | |
param ( | |
[parameter(Mandatory = $true, Position = 0)] | |
[alias('VM')] | |
[String[]]$Name | |
) | |
$finalResult = @() |
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-Function { | |
[cmdletbinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')] | |
param( | |
$ComputerName = $env:computername | |
) | |
PROCESS { | |
if($PSCmdlet.ShouldProcess($ComputerName,'Gathering Services')) { |
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
[cmdletbinding(PositionalBinding = $true)] | |
param ( | |
[parameter(Mandatory = $true, | |
Position = 0)] | |
[System.String[]]$ComputerName, | |
[parameter(Mandatory = $true, | |
Position = 1, | |
HelpMessage = "Enter the account name in 'DOMAIN\USERNAME' notation ")] | |
[System.String]$UserName, |
OlderNewer