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 Enter-AzurePSSession { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string] $ServiceName, | |
[Parameter(Mandatory = $true)] | |
[string] $VMName | |
) | |
$SessionOption = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck; | |
$WinRMUri = Get-AzureWinRMUri -ServiceName $ServiceName -Name $VMName; |
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
$VMList = Get-AzureVM; | |
foreach ($VM in $VMList) { | |
Start-Job -ScriptBlock { | |
Write-Output -Message ('Stopping VM {0} {1}' -f $args[0].ServiceName, $args[0].Name); | |
Stop-AzureVM -ServiceName $args[0].ServiceName -Name $args[0].Name -Force; | |
} -ArgumentList $VM; | |
} |
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 azrdp { | |
<# | |
.Author | |
Trevor Sullivan <pcgeek86@gmail.com> | |
.Description | |
Invoke a RDP session to an Azure Virtual Machine, without having to type the | |
Cloud Service name or Virtual Machine name. | |
.Outputs |
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
### Find the required properties for a particular DSC resource | |
(Get-DscResource | Out-GridView -PassThru).Properties; |
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
<# | |
Author: Trevor Sullivan | |
Date: 2015-03-29 | |
Description: Microsoft Azure Disk objects offer the full URL to the cloud-based VHD | |
however, the Storage Account name is not exposed independently. We can | |
use PowerShell's Add-Member command to parse the URL and offer up the | |
Storage Account as its own property on each Disk object. | |
#> | |
Select-AzureSubscription -SubscriptionName 'Visual Studio Ultimate with MSDN'; |
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
<# | |
.Author | |
Trevor Sullivan <pcgeek86@gmail.com> | |
.Links | |
http://trevorsullivan.net | |
http://twitter.com/pcgeek86 | |
.Description | |
This PowerShell script uses the Microsoft Azure PowerShell module along with PowerShell |
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 Wait-AzureVMDscConfiguration { | |
<# | |
.Synopsis | |
Waits for a DSC configuration to complete on an Azure Virtual Machine. | |
.Parameter ServiceName | |
The name of the Azure Cloud Service containing the Virtual Machine. | |
.Parameter Name | |
The name of the Azure Virtual Machine inside the Cloud Service container. |
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
class Person { | |
[ValidateNotNullOrEmpty()] | |
[string] $FirstName; | |
[ValidateNotNullOrEmpty()] | |
[string] $LastName; | |
[string] $Address; | |
Person([string] $First, [string] $Last) { | |
$this.FirstName = $First; |
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 Prompt { | |
<# | |
.Notes | |
Author: Trevor Sullivan | |
Website: https://trevorsullivan.net | |
Twitter: https://twitter.com/pcgeek86 | |
#> | |
$ATAT = @' | |
____==========_______ | |
_--____ | | "" " "| \ |
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/bash | |
### Visit http://ui.dev.voluminous.io/user-tokens to get a user token | |
### NOTE: This file should contain a function definition called 'fli' | |
source ~/.bash-fli | |
set -e | |
shopt -s expand_aliases |