This file contains hidden or 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 hidden or 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-Module -ListAvailable | Import-Module | |
| #You can also use aliases: | |
| gmo -l | ipmo |
This file contains hidden or 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
| $path = "HKCU:\Software\Microsoft\Office\Lync" | |
| $prop = "EnableSkypeUI" | |
| $value = "1" | |
| Set-ItemProperty -Path $path -Name $prop -Value $value |
This file contains hidden or 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
| <# | |
| ASM identifies the source image used to create a VM by the name of the VHD containing the image. ARM supports a new way to identify the source image for a VM, based on: | |
| Publisher name | |
| SKU | |
| Version | |
| ARM supports the following cmdlets for source images: | |
| #> | |
| Save-AzureVMImage – save a custom image |
This file contains hidden or 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 Get-dotNetVersion | |
| { | |
| $installedDotNet = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" | Select-Object -ExpandProperty Release -ErrorAction Stop | |
| switch ($installedDotNet) | |
| { | |
| 393273 { $ret = "4.6 RC" } | |
| 381029 { $ret = "4.6 RC-older" } | |
| 379893 { $ret = "4.5.2" } | |
| 378675 { $ret = "4.5.1" } |
This file contains hidden or 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
| $resourceGroup = $vars.ResourceGroupName; | |
| $VMName = "memuat-web0" | |
| $ab = Get-AzureVMExtension -ResourceGroupName $resourceGroup -VMName $VMName -ExtensionName dscscript -Status | |
| $ab | out-string | |
| $ab.Statuses |
This file contains hidden or 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
| Configuration WebSiteConfig | |
| { | |
| # Import DSC WebAdmin Module from DSC Resource Kit | |
| Import-DscResource -ModuleName xWebAdministration | |
| Node ("localhost") | |
| { | |
| # Install the Web Server role |
This file contains hidden or 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
| $vm = Get-AzureVM –ServiceName "example-1-svc" –Name "example-1" | |
| $rdp = Get-AzureEndpoint -Name "RDP" -VM $vm | |
| $hostdns = (New-Object "System.Uri" $vm.DNSName).Authority | |
| $port = $rdp.Port | |
| Start-Process "mstsc" -ArgumentList "/V:$hostdns`:$port /w:1024 /h:768 |
This file contains hidden or 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
| # | |
| # ConfigTSDB.sh | |
| # | |
| install_prereqs() | |
| { | |
| sudo bash | |
| cd /home/jciazdeploy | |
| apt-get update -y |
This file contains hidden or 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
| # Authenticate to Azure | |
| Add-AzureAccount | |
| # Select Azure Subscription and Storage Account | |
| $subscriptionName = (Get-AzureSubscription).SubscriptionName | | |
| Out-GridView ` | |
| -Title "Select Your Azure Subcription" ` | |
| -PassThru | |
| Select-AzureSubscription ` |