Skip to content

Instantly share code, notes, and snippets.

View vScripter's full-sized avatar
👨‍💻

Kevin Kirkpatrick vScripter

👨‍💻
View GitHub Profile
function Start-LogLyncAvailability {
[CmdletBinding(
SupportsShouldProcess = $false,
ConfirmImpact = "None",
DefaultParameterSetName = "")]
param (
[Parameter(
Position = 0,
ValueFromPipeLine = $false,
Mandatory = $true,
<#
.SYNOPSIS
This function will log off the specified user/session, based on session ID
.DESCRIPTION
This function will log off the specified user/session, based on session ID.
It was written to accept pipeline input from the Get-LoggedOnUser function, but it can also be run as a stand-alone function, if desired.
.PARAMETER ComputerName
Name of computer/s
<#
.SYNOPSIS
Retrieves all logged on users from a local or remote system
.DESCRIPTION
RRetrieves all logged on users from a local or remote system.
This script/function parses the output from the 'qwinsta' command, and formats it into a proper PSObject
.INPUTS
System.String
@vScripter
vScripter / Remove-UserProfile.ps1
Created March 31, 2015 15:33
Script to remove a selected AD user profile from a system or multiple systems
[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,
function Test-Function {
[cmdletbinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
param(
$ComputerName = $env:computername
)
PROCESS {
if($PSCmdlet.ShouldProcess($ComputerName,'Gathering Services')) {
function Get-OrderedVM {
[cmdletbinding()]
param (
[parameter(Mandatory = $true, Position = 0)]
[alias('VM')]
[String[]]$Name
)
$finalResult = @()
@vScripter
vScripter / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@vScripter
vScripter / Set-ConsoleWindowTitle.ps1
Last active August 29, 2015 14:16
Set-ConsoleWindowTitle - Set the PowerShell console window title to a custom message or a custom 'default' message.
function Set-ConsoleWindowTitle {
[cmdletbinding()]
param (
[parameter(Mandatory = $true,
Position = 0,
ParameterSetName = 'Default')]
[validateset("Default", "Custom")]
[string]$MessageType,
@vScripter
vScripter / Delete-RemoteProfile.ps1
Last active October 5, 2016 10:02
Remove Windows profile from computer using WMI
(Get-WMIObject -ComputerName $computer -Class win32_UserProfile -Filter "SID = $SID").delete()
@vScripter
vScripter / Get-VMToolsB2VMapping.ps1
Created January 28, 2015 03:55
Get VMware Tools Build-to-Version correlations, directly from VMware using Invoke-RestMethod
<#
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'