This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function New-Symlink { | |
<# | |
.SYNOPSIS | |
Creates a symbolic link. | |
#> | |
param ( | |
[Parameter(Position=0, Mandatory=$true)] | |
[string] $Link, | |
[Parameter(Position=1, Mandatory=$true)] | |
[string] $Target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param | |
( | |
[string]$PathToModule='C:\temp\Cos.psm1', | |
[string]$ModuleName = 'cos', | |
[string]$OutputFolderPath='C:\temp', | |
[string]$ResultFileNamePrefix='cos_module', | |
[string]$ResultFileNameSuffix = 'md' | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TRAVELERSINSURANCE 18 | |
VERMöGENSBERATUNG 17 | |
VERMöGENSBERATER 16 | |
SANDVIKCOROMANT 15 | |
CANCERRESEARCH 14 | |
SPREADBETTING 13 | |
INTERNATIONAL 13 | |
VERSICHERUNG 12 | |
SCHOLARSHIPS 12 | |
CONSTRUCTION 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.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 ([email protected]), All rights reserved. |
OlderNewer