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
# variables | |
$StorageAccountName = 'azprepstore' | |
$storSAS = '<SAS token value generated in previous step>' | |
# Create the new storage context with the Account SAS token generated above. | |
$ClientContext = New-AzureStorageContext -SasToken $storSAS -StorageAccountName $StorageAccountName | |
# try to fetch the Blobs using the above context and it will fail | |
# since the SAS token only grants access to the Service level APIs |
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
# variables | |
$resourceGroupName = 'azureprep' | |
$StorageAccountName = 'azprepstore' | |
# Login to ASM & ARM modules, the cmdlets for creating SAS tokens are not yet available under ARM modules | |
Add-AzureAccount | |
Login-AzureRmAccount | |
# Get all azure subscription which are attached with your account | |
Get-AzureSubscription | Sort-Object -Property SubscriptionName | Select-Object -Property SubscriptionName |
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 Test-NetConnectionWithSourceAddress | |
{ | |
[CmdletBinding()] | |
[Alias('PortTestWithSource')] | |
[OutputType([Boolean])] | |
Param | |
( | |
# Specify the remote destination IPAddress. | |
[Parameter(Mandatory=$False, | |
ValueFromPipelineByPropertyName=$true, |
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
@{ | |
AllNodes = @( | |
@{ | |
# common node information hashtable | |
NodeName = '*'; # do not edit | |
SETTeamName = 'S2DSwitch'; # <Edit> name of the SET team | |
DomainDCs = @('testad.Test.lab') # <edit> the DC names (can be a single value) | |
DNSServers = @('testad.Test.lab') # <edit> the DNS names (can be a single value) | |
Domain = 'test.lab' # <edit> the domain name | |
ClusterName = 'r740-mid-s2d-cluster' # <edit> the cluster name, |
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 PSDeployCompletion | |
{ | |
param( $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) | |
$CommandTree = Get-CompletionPrivateData -Key PSDeployCompletionCommandTree | |
if ($null -eq $CommandTree) { | |
$CommandTree = & { | |
New-CommandTree -Completion FromSource -ToolTip 'Source' -Argument | |
New-CommandTree -Completion To -ToolTip 'Destination' -Argument |
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 PSDeployCompletion | |
{ | |
param( $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) | |
$CommandTree = Get-CompletionPrivateData -Key PSDeployCompletionCommandTree | |
if ($null -eq $CommandTree) { | |
$CommandTree = & { | |
New-CommandTree -Completion FromSource -ToolTip 'Source' -Argument | |
New-CommandTree -Completion To -ToolTip 'Destination' -Argument |
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 Test-PortReachableUsingSourceIP | |
{ | |
[CmdletBinding()] | |
[Alias()] | |
[OutputType([int])] | |
Param | |
( | |
# Specify the remote destination IPAddress. | |
[Parameter(Mandatory=$False, | |
ValueFromPipelineByPropertyName=$true, |
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
workflow New-TestVM | |
{ | |
param( | |
# Sepcify the Azure Subscription Name | |
[parameter(Mandatory)] | |
[String] | |
$AzureSubscriptionName, | |
# Sepcify the Azure Storage Account Name to be used to store VM VHDs. | |
[parameter(Mandatory)] |
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
TRY { | |
# search for the Dll | |
Write-Verbose -Message "Creating credential object" | |
$Splathashtable = @{ | |
'Path' = "$env:windir\Microsoft.NET\assembly\"; | |
'Filter' = 'Microsoft.WindowsAzure.ServiceRuntime.dll'; | |
'Include' = '*.dll' | |
} | |
$dllfile = Get-ChildItem @Splathashtable -Recurse | Select-Object -Last 1 # selecting only one object, in case of multiple results |
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
@echo off | |
cd /D %~dp0 | |
if not exist "%DiagnosticStore%\LogFiles" mkdir "%DiagnosticStore%\LogFiles" | |
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Unrestricted -File %* >> "%DiagnosticStore%\LogFiles\%~n1.txt" 2>> "%DiagnosticStore%\LogFiles\%~n1.err.txt" |