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 Write-Log | |
{ | |
param([Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)][AllowEmptyString()][string]$Message) | |
Write-Verbose -Verbose ("[{0:s}] {1}`r`n" -f (get-date), $Message) | |
} |
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
# ************************************************************************************************* | |
# * Configure-CapacityMetrics * | |
# ************************************************************************************************* | |
# * Description: Configures Capacity metrics * | |
# * Author: Richard Slater <richard.slater@amido.co.uk> * | |
# * Date: 2013.02.02 * | |
# * Prerequisites: WAPPSCmdlets (https://www.windowsazure.com/en-us/manage/downloads/) * | |
# ************************************************************************************************* | |
Set-StorageServicePropertiesForAnalytics -ServiceName "Blob" -StorageAccountName "<Storage Account Name>" -StorageAccountKey "<Storage Account Key>" -MetricsEnabled -MetricsRetentionPolicyDays 7 -MetricsRetentionPolicyEnabl |
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
#Reference Site: | |
#http://learn-powershell.net/2014/04/03/checking-out-oneget-in-powershell-v5/ | |
#Show List of what commands are possible | |
get-command -module PackageManagement | |
<# | |
CommandType Name Version Source |
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 Write-Log | |
{ | |
param([Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)][AllowEmptyString()][string]$Message) | |
Write-Verbose -Verbose ("[{0:s}] {1}`r`n" -f (get-date), $Message) | |
} | |
$destHost="10.9.13.21" | |
$user = "administrator" | |
$pass = ConvertTo-SecureString -String "PASSWORD" -AsPlainText -Force |
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
#!/bin/zsh | |
### BEGIN INIT INFO | |
# Provides: hubot | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the hubot service | |
# Description: starts the Hubot bot for the Campfire rooms |
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 | |
Create a configuration transformation | |
.DESCRIPTION | |
This script runs an ASP.NET configuration transformation, given a source | |
configuration and transformation file. MSBuild.exe is assumed to be in | |
the path, and Visual Studio 2012 should be installed. Modify the path to | |
Microsoft.Web.Publishing.Tasks.dll if a different version of Visual Studio | |
is installed. |
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
Switch-AzureMode AzureResourceManager | |
#Show all types | |
(Get-AzureProvider).ResourceTypes | |
#Get just the Compute Resource Types | |
((Get-AzureProvider) | Where-object { $_.ProviderNamespace -eq "Microsoft.Compute" }).resourceTypes | |
((Get-AzureProvider) | Where-object { $_.ProviderNamespace -eq "Microsoft.Network" }).resourceTypes |
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
# Retrieve all available items | |
$allGalleryItems = Invoke-WebRequest -Uri "https://gallery.azure.com/Microsoft.Gallery/GalleryItems?api-version=2015-04-01&includePreview=true" | ConvertFrom-Json | |
# Get all items published by Microsoft | |
$allGalleryItems | Where-Object { $_.PublisherDisplayName -eq "Microsoft" } | |
# Get all gallery items with "SQL" in the description | |
$allGalleryItems | Where-Object { $_.Description -match "SQL" } | |
# Save default template for all items under directory "C:\Templates" |
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 Edit-XmlNodes { | |
param ( | |
[xml] $doc = $(throw "doc is a required parameter"), | |
[string] $xpath = $(throw "xpath is a required parameter"), | |
[string] $value = $(throw "value is a required parameter"), | |
[bool] $condition = $true | |
) | |
if ($condition -eq $true) { | |
$nodes = $doc.SelectNodes($xpath) | |
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
Get-DnsClientServerAddress | |
Set-DNSClientServerAddress -InterfaceAlias "Ethernet" –ServerAddresses ("DNS1","DNS2") | |
Get-DnsClientServerAddress | |
$domain = "DOMAIN" | |
$password = "PASSWORD" | ConvertTo-SecureString -asPlainText -Force | |
$username = "$domain\USER" | |
$credential = New-Object System.Management.Automation.PSCredential($username,$password) | |
Add-Computer -DomainName $domain -Credential $credential |