Skip to content

Instantly share code, notes, and snippets.

View goyalmohit's full-sized avatar

mohit goyal goyalmohit

  • Pune, India
View GitHub Profile
#Specify the directory location to export files
$dirName = "c:\spbackups"
if(!(Test-Path $dirName)){
New-Item -Path $dirName -ItemType Directory -Force
}
Write-Output Exporting solutions to $dirName
foreach ($solution in Get-SPSolution)
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("F:\Dlls for FBA\Metavrse.SharePoint.SyncLib.dll")
#Login into Microsoft Azure
add-azureaccount
#Set default storage account for current azure subscription
Set-AzureSubscription -SubscriptionId <your subscription id> -CurrentStorageAccountName "qastoragenortheurope"
#Create a new storage account, if not already having one
$storageAccountName = "qastoragenortheurope"
$storageAccountLocation = "north europe"
$storageAccountType = "Standard_LRS"
New-AzureStorageAccount -StorageAccountName $storageAccountName -Location $storageAccountLocation -Type $storageAccountType
$imageName = Get-AzureVMImage |
where { $_.ImageFamily -eq $imageFamily } |
sort PublishedDate -Descending |
select -ExpandProperty ImageName -First 1
#create quick azure vm
$adminUser = "itadmin"
$password = "itadmin@123"
$serviceName = "metavrsewebqa"
$location = "north europe"
$size = "Small"
$vmName = "metavrse-web-01"
$imageFamily = "Windows Server 2012 R2 Datacenter"
New-AzureQuickVM -Windows `
#Login into Microsoft Azure
add-azureaccount
#Create a new storage account, if not already having one
$storageAccountName = "qastoragenortheurope"
$storageAccountLocation = "north europe"
$storageAccountType = "Standard_LRS"
New-AzureStorageAccount -StorageAccountName $storageAccountName `
-Location $storageAccountLocation `
-Type $storageAccountType
#Login into Microsoft Azure
add-azureaccount
#Create a new storage account, if not already having one
$storageAccountName = "qastoragenortheurope"
$storageAccountLocation = "north europe"
$storageAccountType = "Standard_LRS"
New-AzureStorageAccount -StorageAccountName $storageAccountName `
-Location $storageAccountLocation `
-Type $storageAccountType
# Configures execution policy to remotesigned
if($(Get-ExecutionPolicy) -ne "RemoteSigned"){
Set-ExecutionPolicy RemoteSigned -Confirm:$false
}
# Installs chocolatey package manager
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
# Installs JDK8 using chocolatey
choco install jdk8 -y