Skip to content

Instantly share code, notes, and snippets.

View Sarafian's full-sized avatar

Alex Sarafian Sarafian

View GitHub Profile
@Sarafian
Sarafian / Compare-SystemModuleWithGallery.ps1
Created October 14, 2016 11:10
Compare PowerShell system module with their PowerShell gallery counterparts
<#
.Synopsis
Compares system modules with available ones on powershell gallery
.DESCRIPTION
Compares system modules with available ones on powershell gallery
.EXAMPLE
Compare-SystemModuleWithGallery
.Link
http://mikefrobbins.com/2016/06/09/update-manually-installed-powershell-modules-from-the-powershell-gallery/
#>
#Requires -RunAsAdministrator
<#
.Synopsis
Creates a new Hyper-V instance from a named template.
.DESCRIPTION
Imports an existing Hyper-V export into a new instance, set-up the local client host/ip resoltution and generate bootstrapping powershell script.
.PARAMETER OSVersion
The code name for operating system
.PARAMETER VMName
@Sarafian
Sarafian / Compare-WindowsFeatureName.ps1
Last active October 22, 2016 12:19
With this script you can compare and get a report for the windows feature names between two different versions of Windows Server.
param(
[Parameter(Mandatory=$true)]
[string]$NewWindowsServerVersionComputer,
[Parameter(Mandatory=$true)]
[string]$OldWindowsServerVersionComputer
)
# Process new windows server version
$featuresOnNew=Get-WindowsFeature -ComputerName $NewWindowsServerVersionComputer
$availableOnNew=$featuresOnNew|Where-Object -Property "InstallState" -EQ "Available"
$installedNew=$featuresOnNew|Where-Object -Property "InstallState" -EQ "Installed"
@Sarafian
Sarafian / Reset-PrefixedTitle.ps1
Last active October 22, 2016 12:19
Set/Reset a prefix on the PowerShell's Console Window title
<#
.Synopsis
Reset the window title of the console
.DESCRIPTION
Reset the window title of the console
.EXAMPLE
Reset-PrefixedTitle
#>
function Reset-PrefixedTitle
{