Skip to content

Instantly share code, notes, and snippets.

View vScripter's full-sized avatar
👨‍💻

Kevin Kirkpatrick vScripter

👨‍💻
View GitHub Profile
<#
HTML Server Disk Usage Report Script
Kevin Kirkpatrick
nullzero.io
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 / Get-VMDetails.ps1
Created April 4, 2017 17:16
Returns more detailed statistics and configuration for a single or multiple VMs
function Get-VMDetails {
<#
.SYNOPSIS
Returns more detailed statistics and configuration for a single or multiple VMs
.DESCRIPTION
Returns more detailed statistics and configuration for a single or multiple VMs
This function assumes that you are already connected to one, or more, vCenter Servers.
@vScripter
vScripter / PS Credential Encryption using Certs.ps1
Last active November 1, 2021 23:03
Example of how to use the ProtectedData PowerShell module to encrypt and decrypt credentials using a certificate
<#
These are examples of the process flow of using the ProtectedData PowerShell Module to encrypt a credential using certificates
on two servers
https://github.com/dlwyatt/ProtectedData
This does not represent a recommended approach, per se, but it does offer another secure means of persisting credentials to
a file vs. using DPAPI (Data Protection API); it's mainly written to help people grasp some basic concepts of asymmetric
encryption, in action.
@vScripter
vScripter / Start-PowerCLI.ps1
Last active March 22, 2017 15:09
PowerCLI 'loader' function
function Start-PowerCLI {
<#
.NOTES
Loads PowerCLI, depending on what version you have installed. Set the default -Version parameter, depending in your environment.
#>
[cmdletbinding()]
param (
[parameter(Mandatory = $false, Position = 0)]
@vScripter
vScripter / ESXi VTEP Report.ps1
Last active August 10, 2016 19:07
Basic script to pull an inventory of ESXi VTEP interfaces
$vtepReportPath = "$Home\Desktop\ESXi_VTEP_Report.csv"
$vtepFinalReport = @()
Get-VMHostNetworkAdapter -VMKernel | Foreach-Object {
$vtepInterfaceQuery = $null
$vtepInterfaceQuery = $_.ExtensionData | Where-Object {$_.Spec.NetStackInstanceKey -eq 'vxlan'}
foreach ($vtep in $vtepInterfaceQuery) {
@vScripter
vScripter / Get-VMHostVtepInterface.ps1
Last active August 10, 2016 18:59
Pull an inventory of all ESXi VTEP virtual interfaces from all connected vCenter Servers
function Get-VMHostVtepInterface {
<#
.SYNOPSIS
Gather VTEP interface inventory from all ESXi hosts
.DESCRIPTION
Gather VTEP interface inventory from all ESXi hosts.
This function was written with scale and speed in mind. It pull a host inventory using API calls and then unrolls API properties and
assigned them to a PSCustomObject.
@vScripter
vScripter / Get-VMGuestNetworkAdapter.ps1
Last active July 27, 2016 15:28
Returns VM Guest network adapter information, including detail about the virtual & IP interfaces
# this moved to the following repository: https://github.com/vScripter/vSphereNetworkInventory
@vScripter
vScripter / Get-VMDetails.ps1
Created April 7, 2016 16:18
Get-VMDetails.ps1
function Get-VMDetails {
<#
.SYNOPSIS
Returns more detailed statistics and configuration for a single or multiple VMs
.DESCRIPTION
Returns more detailed statistics and configuration for a single or multiple VMs
.PARAMETER Server
VI (vCenter) server name
@vScripter
vScripter / New-Object.ps1
Created April 13, 2015 03:44
Creating new object
$queryItems = Get-Service | Select ServiceName,Status
foreach ($service in $queryItems) {
# clear on each iteration
$objSvc = @()
# create properties and assign values; in this example I am using strong types to define the type of value
# the property will return
$objSvc = [PSCustomObject] @{
Service = [System.String]$service.ServiceName
# No need for the code on the next line, just put the functions in this script; you run into scoping issues dot sourcing these functions, the way they are written
#. .\func1.ps1
#region functions
function Start-LogLyncAvailability {
[CmdletBinding(
SupportsShouldProcess = $false,
ConfirmImpact = "None",
DefaultParameterSetName = "")]