Skip to content

Instantly share code, notes, and snippets.

Kevin Kirkpatrick vScripter

Block or report user

Report or block vScripter

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vScripter
vScripter / HTML_Server_Disk_Space_Report.ps1
Last active Dec 22, 2015
HTML PowerShell Server Disk Space Report
View HTML_Server_Disk_Space_Report.ps1
<#
HTML Server Disk Usage Report Script
Kevin Kirkpatrick
www.vmotioned.com
Created 7/31/2013
This report, as currently written, is meant to create and save the HTML report in a location of your Choosing.
If attaching the HTML report is desired, edit the EMail settings attachemtn location variable and go to the
bottom of the script and un-comment the attachment options.
#>
@vScripter
vScripter / Invoke-LocalAdminAudit.ps1
Created Apr 9, 2014
Get Members of the local Administrators group on Selected Computers/Servers
View Invoke-LocalAdminAudit.ps1
[cmdletbinding()]
param (
[parameter(mandatory = $true)]
[string[]]$Servers
)
$results = @()
@vScripter
vScripter / Get-ProcessorInventory.ps1
Created Apr 16, 2014
Returns information about the Processor via WMI
View Get-ProcessorInventory.ps1
<#
.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
@vScripter
vScripter / Invoke-CPUStressTest.ps1
Created May 6, 2014
Saturate selected or all CPU cores for utilization stress testing, etc.
View Invoke-CPUStressTest.ps1
[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
@vScripter
vScripter / Get-NetStat.ps1
Last active Sep 22, 2016
Get-NetStat PowerShell Function
View Get-NetStat.ps1
function Get-NetStat
{
<#
.SYNOPSIS
This function will get the output of netstat -n and parse the output
.DESCRIPTION
This function will get the output of netstat -n and parse the output.
Credit goes to PowerShell MVP Francois-Xavier Cat, who wrote the orignial function to parse the output of netstat.exe -n.
@vScripter
vScripter / Get-WinProductKey.ps1
Last active Dec 21, 2017
Return windows product key
View Get-WinProductKey.ps1
function Get-WinProductKey {
$map="BCDFGHJKMPQRTVWXY2346789"
$value = (get-itemproperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").digitalproductid[0x34..0x42]
$ProductKey = ""
for ($i = 24; $i -ge 0; $i--) {
$r = 0
for ($j = 14; $j -ge 0; $j--) {
$r = ($r * 256) -bxor $value[$j]
$value[$j] = [math]::Floor([double]($r/24))
$r = $r % 24
@vScripter
vScripter / xGet-DiskSpace.ps1
Created Dec 20, 2014
PS Custom Object Example
View xGet-DiskSpace.ps1
[cmdletbinding(PositionalBinding = $true,
DefaultParameterSetName = "Default")]
param (
[parameter(mandatory = $false,
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true,
Position = 0)]
[alias('Comp', 'Name', 'DNSHostName')]
[string[]]$ComputerName = 'localhost'
)
@vScripter
vScripter / Add-PowerCLI.ps1
Last active Aug 29, 2015
PowerCLI PSSnapins
View Add-PowerCLI.ps1
<#
.DESCRIPTION
Load appropriate PowerCLI PSSnapins. These are based on PowerCLI 5.8 R1.
#>
[cmdletbinding()]
param()
PROCESS {
try {
@vScripter
vScripter / Get-VMToolsB2VMapping.ps1
Created Jan 28, 2015
Get VMware Tools Build-to-Version correlations, directly from VMware using Invoke-RestMethod
View Get-VMToolsB2VMapping.ps1
<#
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'
@vScripter
vScripter / Delete-RemoteProfile.ps1
Last active Oct 5, 2016
Remove Windows profile from computer using WMI
View Delete-RemoteProfile.ps1
(Get-WMIObject -ComputerName $computer -Class win32_UserProfile -Filter "SID = $SID").delete()
You can’t perform that action at this time.