Skip to content

Instantly share code, notes, and snippets.

View KurtDeGreeff's full-sized avatar

Kurt De Greeff KurtDeGreeff

View GitHub Profile
@KurtDeGreeff
KurtDeGreeff / AutoMarkdown.ps1
Created November 3, 2015 11:15 — forked from RafPe/AutoMarkdown.ps1
Autodocument your Powershell modules using Markdown
param
(
[string]$PathToModule='C:\temp\Cos.psm1',
[string]$ModuleName = 'cos',
[string]$OutputFolderPath='C:\temp',
[string]$ResultFileNamePrefix='cos_module',
[string]$ResultFileNameSuffix = 'md'
)
@KurtDeGreeff
KurtDeGreeff / Connect.ps1
Created November 9, 2015 12:28 — forked from eugenedauphin/Connect.ps1
Easily connect to your Office 365 tenant with Windows PowerShell
# +----------------------------------------------------------------------------+
# | File    : StoreCredentials.ps1 |
# | Author  : Eugène Dauphin |
# | Version : 1.1 |
# | Purpose : Connect to an Office 365 PowerShell Connection |
# | |
# | Synopsis: |
# | Usage : .\Connect.ps1 .\FolderNameOfConnection |
# +----------------------------------------------------------------------------+
# | Maintenance History                                                        |
@KurtDeGreeff
KurtDeGreeff / StoreCredentials.ps1
Created November 9, 2015 12:29 — forked from eugenedauphin/StoreCredentials.ps1
Store your Office 365 Credentials to easily connect with Windows PowerShell
# | |
# | Synopsis: |
# | Usage : .\StoreCredentials.ps1 .\FolderNameOfConnection |
# +----------------------------------------------------------------------------+
# | Maintenance History                                                        |
# | -------------------                                                        |
# | Name            Date       Version  Description                           |
# | ---------------------------------------------------------------------------+
# | Eugène Dauphin   18-09-2014 1.0      Initial Version                       |
# | Eugène Dauphin   26-08-2015 1.1      Force switch and dir create added |
@KurtDeGreeff
KurtDeGreeff / WMIProxyCommands.ps1
Created November 17, 2015 19:33 — forked from DBremen/WMIProxyCommands.ps1
Proxy commands for Get-WmiObject and Get-CimInstance that support PowerShell query syntax via 'PowerShellFilter' paramater
foreach ($command in ('Get-WmiObject','Get-CimInstance')){
$Metadata = New-Object System.Management.Automation.CommandMetaData (Get-Command $command)
$proxyCmd = [System.Management.Automation.ProxyCommand]::Create($Metadata) #| clip
if ($command -eq 'Get-WmiObject'){
$newParam = @'
[Parameter(ParameterSetName='query')]
[ScriptBlock]
$PowerShellFilter,
'@
}
Set-StrictMode -Version 2.0
function Get-SqlDataScript {
param(
[Parameter(Mandatory, Position = 0)]
[string] $ServerName,
[Parameter(Mandatory, Position = 1)]
[string] $InstanceName,
@KurtDeGreeff
KurtDeGreeff / Out-More.ps1
Last active December 28, 2015 18:48 — forked from jdhitsolutions/Out-More.ps1
A function to pipe objects to the pipeline and console in groups or pages.
#requires -version 4.0
Function Out-More {
<#
.Synopsis
Send "pages" of objects to the pipeline.
.Description
This function is designed to display groups or "pages" of objects to the PowerShell pipeline. It is modeled after the legacy More.com command line utility.
By default the command will write out objects out to the pipeline in groups of 50. You will be prompted after each grouping. Pressing M or Enter will get the next group. Pressing A will stop paging and display all of the remaining objects. Pressing N will display the next object. Press Q to stop writing anything else to the pipeline.
Function Get-Direction()
{
Param(
[Parameter(Mandatory=$true,Position=0)] $Origin,
[Parameter(Mandatory=$true,Position=1)] $Destination,
[Parameter(Position=2)] [ValidateSet('driving','bicycling','walking')] $Mode ="driving",
[Switch] $InMiles
)
@KurtDeGreeff
KurtDeGreeff / gist:469a25dbe3460692d2d5
Created February 26, 2016 12:57 — forked from kabronkline/gist:6581453
PowerShell SVN Checkout / Export
# SVN Export Script
#
# Given an SVN URL and local directory path, this script copies all files from
# SVN into the specified local directory.
#
# Uses SharpSVN DLL v1.7002.1998 (Documentation : http://docs.sharpsvn.net/current/)
#
# Takes two command line arguments, an SVN URL and a local directory path.
param ([string]$svnUrl = $(read-host "Please specify the path to SVN"),
[string]$svnLocalPath = $(read-host "Please specify the local path"),
@KurtDeGreeff
KurtDeGreeff / Advanced.log
Created February 28, 2016 15:58 — forked from BladeFireLight/Advanced.log
OMAPSUG Febuary 2016
**********************
Windows PowerShell transcript start
Start time: 20160220181407
Username: SHODAN\Blade_000
RunAs User: SHODAN\Blade_000
Machine: SHODAN (Microsoft Windows NT 10.0.10586.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe
Process ID: 9456
PSVersion: 5.0.10586.63
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0.10586.63
@KurtDeGreeff
KurtDeGreeff / BuildWebServer
Created March 12, 2016 16:43 — forked from jbenson444/BuildWebServer
Build Web Server for a DSC Demo
$ConfigData =@{
AllNodes = @(
@{
NodeName = "localhost"
PSDSCAllowPlainTextPassword = $True
}
)
}