Skip to content

Instantly share code, notes, and snippets.

@MasayukiOzawa
MasayukiOzawa / v2vm.ps1
Last active November 20, 2015 15:39
ARM の VM 作成
# https://msdn.microsoft.com/en-us/library/azure/mt619274.aspx
# https://msdn.microsoft.com/en-us/library/azure/mt603754.aspx
# http://statemachine.hatenablog.com/entry/2015/07/06/183650
# http://statemachine.hatenablog.com/entry/2015/07/22/183239
# https://azure.microsoft.com/ja-jp/documentation/articles/resource-group-overview/
# https://gist.github.com/nmackenzie/54e9fe4bb34f8d6bce2e
$azaccount = Login-AzureRmAccount
$subscription = Get-AzureRmSubscription | Out-GridView -OutputMode Single
$cred = Get-Credential
$Node = @("2016-WSFC-01", "2016-WSFC-02", "2016-WSFC-03")
$script = {
$SQLSetup = "D:\setup.exe"
$InstallConfig = @'
;SQL Server 2016 CTP2.3 Configuration File
[OPTIONS]
; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.
$cred = Get-Credential
$Node = @("10.200.0.6", "10.200.0.7", "10.200.0.9")
$script = {
if((Get-WindowsFeature -Name Failover-Clustering).InstallState -ne "Installed"){
Install-WindowsFeature -Name Failover-Clustering -IncludeManagementTools
}else{
Write-Output "Failover-Clustering Feature has Installed"
}
$Results = New-Object -TypeName System.Collections.Generic.List[PSCustomObject]
$aryBlockSize = @("4K", "8K", "64K", "128K", "256K")
$aryThread = @(1,2,8,16)
$aryPattern = @("si", "r")
$duration = 60
$TestFile = "E:\test.dat"
$DiskSpd = "C:\Diskspd-v2.0.15\amd64fre\diskspd.exe"
$BaseCmd = "$DiskSpd -c10G -b{0} -o1 -h -t{1} -{2} {3} -Rxml -d{4} $TestFile"
tzutil.exe /s "Tokyo Standard Time"
$NewList = New-WinUserLanguageList -Language "ja-JP"
$NewList.Add("en-US")
Set-WinUserLanguageList $NewList -Force
Set-WinUILanguageOverride ja-JP
Set-WinHomeLocation 0x7A
Set-ItemProperty -Path registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters\ -Name "LayerDriver JPN" -Value "kbd106.dll" -Type String
Set-ItemProperty -Path registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters\ -Name "OverrideKeyboardIdentifier" -Value "PCAT_106KEY" -Type String
Set-ItemProperty -Path registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters\ -Name "OverrideKeyboardSubtype" -Value 2 -Type DWord
[Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
$Server = "hogehoge"
$Login = "hogehoge"
$Password = "hogehoge"
$DBName = "hogehoge"
$TableName = "hogehoge"
$SQLServer = New-Object Microsoft.SqlServer.Management.Smo.Server($Server)