Skip to content

Instantly share code, notes, and snippets.

@lipkau
lipkau / Start-WebServer.ps1
Last active March 9, 2017 15:33
Create local http server using PHP.exe #powershell #helperFunction #workflow
<#PSScriptInfo
.VERSION 1.0
.GUID 9c74d64a-774d-4f5a-a8c4-485fd079e7bd
.AUTHOR
Oliver Lipkau <oliver@lipkau.net>
.COPYRIGHT
Oliver Lipkau
@lipkau
lipkau / New-Folder.ps1
Last active October 16, 2017 15:04
Create new folder and naviagte into it #powershell #helperFunction #workflow
function New-Folder
{
<#
.Synopsis
Create a new folder and navigate into it
.Description
Create a new folder and navigate into it
.Notes
@lipkau
lipkau / Format-Wide.ps1
Last active February 24, 2016 10:13
[PowerShell] ProxyFunction: Pivot Format-Wide output
function Format-Wide {
[CmdletBinding(HelpUri='http://go.microsoft.com/fwlink/?LinkID=113304')]
param(
[Parameter(
Position=0
)]
[System.Object]${Property},
[switch]${AutoSize},
[CmdletBinding()]
[OutputType([System.Management.Automation.PSModuleInfo])]
param(
# The name of the module to install from GitHub.
[Parameter(Position=0, Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[System.String[]]
$ModuleName,
# The scope from which the module should be discoverable.
@lipkau
lipkau / hashtable_transformation.ps1
Last active October 19, 2015 09:13
[BUG] Transform HashTable to Custom Object
Add-Type -TypeDefinition @"
using System;
namespace foo
{
public struct bar {
public Int64 id;
}
}
"@
@lipkau
lipkau / $(...) Complex Subexpression.sublime-snippet
Created September 8, 2015 06:23
[PowerShell] Snippet: My Sublime Text 3 PowerShell Snippets
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[\$($1)]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>sub</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>source.powershell</scope>
</snippet>
@lipkau
lipkau / Get-Uptime.ps1
Last active September 5, 2015 17:43
Get Computer's uptime
function Get-Uptime
{
<#
.SYNOPSIS
Get Computer's uptime
.DESCRIPTION
Returns the total time since the last reboot
.NOTES