Skip to content

Instantly share code, notes, and snippets.

View vScripter's full-sized avatar
👨‍💻

Kevin Kirkpatrick vScripter

👨‍💻
View GitHub Profile
@vScripter
vScripter / Suspend-ScreenSaver.ps1
Created August 2, 2021 19:41
Suspend-ScreenSaver.ps1
<#
.NOTES
###########################################################
# NoSSaver.ps1
#
# Wayne Lindimore
# wlindimore@gmail.com
# AdminsCache.Wordpress.com
#
function Get-RDM {
[OutputType([System.Management.Automation.PSCustomObject])]
[cmdletbinding(DefaultParameterSetName = 'default')]
param (
[parameter(
Mandatory = $true,
ValueFromPipeline = $true,
Position = 0,
ParameterSetName = 'default')]
@vScripter
vScripter / Get-PendingReboot.ps1
Created August 13, 2018 19:56
Gets the pending reboot status on a local or remote computer.
<#
.SYNOPSIS
Gets the pending reboot status on a local or remote computer.
.DESCRIPTION
This function will query the registry on a local or remote computer and determine if the
system is pending a reboot, from either Microsoft Patching or a Software Installation.
For Windows 2008+ the function will query the CBS registry key as another factor in determining
pending reboot state. "PendingFileRenameOperations" and "Auto Update\RebootRequired" are observed
as being consistant across Windows Server 2003 & 2008.
@vScripter
vScripter / VMHost-Mapping.ps1
Last active July 26, 2018 14:40
PowerCLI example using Get-View filtering to create a VMHost inventory mapping
# Gather a list of Datacenters, but only pull the name
$datacenterQuery = Get-View -Server $viServer -ViewType Datacenter -Property Name -ErrorAction 'Stop'
foreach ($datacenter in $datacenterQuery) {
# Grab a list of clusters, but only pull the name - also use the current datacenter as the search root
$clusterQuery = Get-View -Server $viServer -ViewType ClusterComputeResource -Property Name -SearchRoot $datacenter.MoRef
foreach ($cluster in $clusterQuery) {
@vScripter
vScripter / Docker-alpine-test.sh
Last active February 28, 2018 04:12
Docker Commit Test
docker build -t vscripter/alpine-ssh:v1 .
docker push vscripter/alpine-ssh:v1
# ran a few commands and then jumped out and left the container running
docker run -it --name alpine-v2 vscripter/alpine-ssh:v1
# added elinks just to test
docker exec -it alpine-v2 apk add elinks
docker commit alpine-v2 vscripter/alpine-ssh:v2
@vScripter
vScripter / Get-VILicense.ps1
Created September 21, 2017 19:06
Return vSphere licenses from a vCenter Server
function Get-VILicense {
<#
.SYNOPSIS
Return vSphere license deatils from the connected vCenter Server(s)
.DESCRIPTION
Return vSphere license deatils from the connected vCenter Server(s)
.EXAMPLE
Get-VILicense -Verbose
.OUTPUTS
# check to see if IPv6 config status
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
# edit sysctl.conf
vi /etc/sysctl.conf
#disable ipv6 
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Work Log

Friday, February 06, 2015

  • This is the first item of the day
    • This is the first sub-item of the day
      • This is the first sub-sub-item of the day
  • This is the second item of the day
  • This is what using back-tick marks through the PowerShell console can be used to show code in the GFM
## Work Log
### Friday, February 06, 2015
* This is the first item of the day
* This is the first sub-item of the day
* This is the first sub-sub-item of the day
* This is the second item of the day
* This is what using back-tick marks through the PowerShell console can be used to ``show code`` in the GFM
Add-WorkLog 'This is the first item of the day'
Add-WorkLog 'This is the first sub-item of the day' -Indent 1
Add-WorkLog 'This is the first sub-sub-item of the day' -Indent 2
Add-WorkLog 'This is the second item of the day'
Add-WorkLog "This is how using back-tick marks through the PowerShell console can be used to ````show code```` in the GFM"