Skip to content

Instantly share code, notes, and snippets.

View ploegert's full-sized avatar
💭
¯\_(ツ)_/¯

Justin Ploegert ploegert

💭
¯\_(ツ)_/¯
View GitHub Profile
@ploegert
ploegert / Crossing Resource Groups.json
Created May 30, 2015 16:52
Often you may want to use a resource from outside of the current resource group where a template is getting deployed. The most common case for this behavior is using a storage account or virtual network in an alternate resource group. This is often needed so that the deletion of the resource group which contains the virtual machines will not res…
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualNetworkName": {
"type": "string"
},
"virtualNetworkResourceGroup": {
"type": "string"
},
@ploegert
ploegert / Reset-AzureVMUserPassword.ps1
Created June 8, 2015 19:20
Reset Azure VM User Password
Function Reset-AzureVMUserPassword {
param (
[String]
$VMName,
[String]
$ServiceName,
[PSCredential]
$Credential
@ploegert
ploegert / Get-AzurePowershellMSI.ps1
Created June 8, 2015 19:21
Get Latest Powershell MSI Install
Function Test-Url {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[String] $Url
)
Process {
if ([system.uri]::IsWellFormedUriString($Url,[System.UriKind]::Absolute)) {
$true
@ploegert
ploegert / log.ps1
Created June 9, 2015 14:25
Utilities for logging.
<#
Utilities for logging.
NOTE: This module is used by the install script, which must run on PowerShell 2.0
Be sure to test any changes to this module using PS 2.0.
#>
Set-StrictMode -Version latest
$ErrorActionPreference = 'stop'
@ploegert
ploegert / Download-File.ps1
Created June 9, 2015 14:27
Downloads a file from a url and outputs the path to the file
#
# Downloads the given URL to a local file and outputs the path to the file
#
function Download
{
param([Parameter(Mandatory=$true)][string] $Url)
$webClient = $null
try
@ploegert
ploegert / Install-Hotfix.ps1
Created June 9, 2015 14:29
Installs the given hotfix via powershell
<#
.Synopsis
Installs the given hotfix
#>
function Install-Hotfix
{
param(
[Parameter(Mandatory=$true)]
[string] $Url,
[Parameter(Mandatory=$true)]
@ploegert
ploegert / Enable-PSRemoting.ps1
Created June 9, 2015 14:30
Install PowershelL remoting Enables PowerShell remoting
#
# Enables PowerShell remoting
#
function Enable-Remoting
{
[CmdletBinding()]
param()
Write-Log 'Enabling PowerShell Remoting...'
@ploegert
ploegert / Get-WindowsAzurePowershellVersion.ps1
Created June 9, 2015 15:21
Get the latest Azure Powershell Versions
function Get-WindowsAzurePowerShellVersion
{
[CmdletBinding()]
Param ()
## - CHECK INSTALLED VERSION
Write-Host "`r`nInstalled version: " -ForegroundColor 'Yellow';
import-module azure
(Get-Module -name "Azure" | Where-Object{ $_.Name -eq 'Azure' }) | Select Version, Name, Author | Format-List;
## - CHECK WEB PI FOR AVAILABLE VERSION
@ploegert
ploegert / Sample_NuGet_InstallPackage.ps1
Created June 9, 2015 19:04
Sample DSC Nuget package provider installation
#
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.