Skip to content

Instantly share code, notes, and snippets.

function Remove-ConstrainedLanguageMode {
<#
.Synopsis
Set language mode for a powershell session to 'full'.
.Description
Set language mode for a powershell session to 'full'. Leverages 'InstallUtil'
and the Microsoft.Diagnostics.Runtime.dll resouces to adjust in memory values.
.Example
# Event data after netlogon semaphoreAcquires >=1 added...
Event filter with query "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance Isa "Win32_PerfFormattedData_Counters_Netlogon" AND TargetInstance.Name="_Total" AND TargetInstance.SemphoreAcquires >=1" could not be reactivated in namespace "//./root/CIMV2" because of error 0x80041002. Events cannot be delivered through this filter until the problem is corrected.
@jschell
jschell / get-dateTime.ps1
Created September 23, 2015 23:55
ISO8601 dateTime
function get-dateTime
{
<#
.Synopsis
Returns ISO8601 date time format representation of current time.
.Description
At minimum, returns string with date as YYYY, mm, dd and time as HH, MM (24 hour time). Parameters allow for seconds and timezone of current locale to be returned.
.Parameter Format
#Requires -Module ActiveDirectory
<#
.SYNOPSIS
This script retrieves the ACL from an Active Directory-integrated DNS record
.NOTES
Created on: 8/5/2014
Created by: Adam Bertram
Filename: Get-AdDnsRecordAcl.ps1
.EXAMPLE
@jschell
jschell / connect-azurePSSession.ps1
Last active August 29, 2015 14:03
Functions to make WinRM on azure run smoother
function connect-azurePSSession
{
<#
borrowed from : http://jrich523.wordpress.com/2010/07/21/update-creating-a-profile-for-a-remote-session/
#>
[cmdletBinding()]
Param(
[Parameter(Mandatory=$True)]
Bakers & Chefs Dinner Forks - 36ct
http://www.amazon.com/gp/product/B0024NXW6U/
Bakers & Chefs Dinner Spoons - 36ct
http://www.amazon.com/gp/product/B007SUJZOM/
Bakers & Chefs Dinner Knives - 36ct
http://www.amazon.com/gp/product/B007XUL64O/
12 oz Clear Plastic Tumbler
function Get-InstalledSoftware
{
<#
.Summary
Get installed Software (browse the uninstall registry values...)
.Link
http://jeffwouters.nl/index.php/2014/01/a-powershell-function-to-get-the-installed-software/
.Notes
2014-01-30
Adjusted to provide searching of both x64 and x32 store for x64 boxes...
#requires -version 2.0
Add-Type @"
public class Shift {
public static int Right(int x, int count) { return x >> count; }
public static uint Right(uint x, int count) { return x >> count; }
public static long Right(long x, int count) { return x >> count; }
public static ulong Right(ulong x, int count) { return x >> count; }
public static int Left(int x, int count) { return x << count; }
public static uint Left(uint x, int count) { return x << count; }
public static long Left(long x, int count) { return x << count; }
'Twas the night before Christmas, when all through the racks
Not a server was alerting, not even Compaqs.
The backups were written to tapes with care
In hopes that later the data would be there.
The machines were nestled all snug in their sleds
Whilst visions of vengeance danced in their heads;
And oncall in his three-wolf and I in my rack.
Had just settled down for some syn and some ack.
@jschell
jschell / scratch-psake-recipe.ps1
Last active December 16, 2015 13:58
Initial psake style recipe to install a windows feature
task add-roleADFS -depends serverManager
{
add-windowsFeature AD-Federation-Services
add-windowsFeature ADFS-Federation
}
task serverManager -depends adminShell
{
import-module serverManager
}