Skip to content

Instantly share code, notes, and snippets.

@julionc
julionc / slideshare-dl.py
Created September 17, 2011 16:11
slideshare-dl is a small command-line program for downloading slides from SlideShare.net
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
slideshare-dl.py
~~~~~~~~~~~~~~~~
slideshare-dl is a small command-line program
for downloading slides from SlideShare.net
@jpoehls
jpoehls / mklink.psm1
Created June 7, 2012 19:40
Native PowerShell wrapper for MKLINK.
@9to5IT
9to5IT / Script_Template.ps1
Last active April 9, 2024 14:01
PowerShell: Script Template
#requires -version 2
<#
.SYNOPSIS
<Overview of script>
.DESCRIPTION
<Brief description of script>
.PARAMETER <Parameter_Name>
<Brief description of parameter input required. Repeat this attribute if required>
@alimbada
alimbada / Export-Chocolatey.ps1
Last active April 21, 2024 11:39
Export installed Chocolatey packages as packages.config - thanks to Matty666
#Put this in Export-Chocolatey.ps1 file and run it:
#.\Export-Chocolatey.ps1 > packages.config
#You can install the packages using
#choco install packages.config -y
Write-Output "<?xml version=`"1.0`" encoding=`"utf-8`"?>"
Write-Output "<packages>"
choco list -lo -r -y | % { " <package id=`"$($_.SubString(0, $_.IndexOf("|")))`" version=`"$($_.SubString($_.IndexOf("|") + 1))`" />" }
Write-Output "</packages>"
@RafPe
RafPe / AutoMarkdown.ps1
Last active December 3, 2017 23:00
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'
)
@bortzmeyer
bortzmeyer / gist:705384b215034162da92
Created December 16, 2015 17:00
The longest TLD (including Unicode ones)
TRAVELERSINSURANCE 18
VERMöGENSBERATUNG 17
VERMöGENSBERATER 16
SANDVIKCOROMANT 15
CANCERRESEARCH 14
SPREADBETTING 13
INTERNATIONAL 13
VERSICHERUNG 12
SCHOLARSHIPS 12
CONSTRUCTION 12
@jdhitsolutions
jdhitsolutions / PowerShellNap.ps1
Last active February 21, 2022 09:44
An advanced PowerShell function that you can use as an alarm clock while taking a nap.
#requires -Version 5.1
Function Start-PSNap {
<#
.SYNOPSIS
Start a PowerShell napping session.
.DESCRIPTION
Use this command to start a short napping session. The command will alert you when you nap is up with a chime and a message. You have an option of displaying the message on the screen or having it spoken.
@davefunkel
davefunkel / Script-Template-WithCreds.ps1
Last active May 23, 2024 07:01
PowerShell Script Template with Saved Creds
<#
.SYNOPSIS
The synopsis goes here. This can be one line, or many.
This version of the template has inbuilt functions to capture credentials and store it securely for reuse
Avoids the need to have plaintext passwords in the script
.DESCRIPTION
The description is usually a longer, more detailed explanation of what the script or function does.
Take as many lines as you need.
@proxb
proxb / Struct.ps1
Created April 27, 2017 22:54
Using PowerShell and Reflection to dynamically build a Struct with Constructors and Methods
#region Module Builder
$Domain = [AppDomain]::CurrentDomain
$DynAssembly = New-Object System.Reflection.AssemblyName(([guid]::NewGuid().ToString()))
$AssemblyBuilder = $Domain.DefineDynamicAssembly($DynAssembly, [System.Reflection.Emit.AssemblyBuilderAccess]::Run) # Only run in memory
$ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(([guid]::NewGuid().ToString()), $False)
#endregion Module Builder
#region STRUCTs
#Order of creating these Structs is important
#region MyStruct
$Attributes = 'AutoLayout, AnsiClass, Class, Public, SequentialLayout, Sealed, BeforeFieldInit'
@keithga
keithga / Get-LatestUpdate.ps1
Last active February 23, 2024 13:17
script to get latest build.
<#
.SYNOPSIS
Get the latest Cumulative update for Windows
.DESCRIPTION
This script will return the list of Cumulative updates for Windows 10 and Windows Server 2016 from the Microsoft Update Catalog.
.NOTES
Copyright Keith Garner (KeithGa@DeploymentLive.com), All rights reserved.