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
    
  
  
    
  | PS C:\Windows\system32> Get-AzureRmVirtualNetworkSubnetConfig -VirtualNetwork "VNET1" -Name "subnet1" | |
| Get-AzureRmVirtualNetworkSubnetConfig : Cannot bind parameter 'VirtualNetwork'. Cannot convert the "VNET1" value of type "System.String" to type | |
| "Microsoft.Azure.Commands.Network.Models.PSVirtualNetwork". | |
| At line:1 char:55 | |
| + Get-AzureRmVirtualNetworkSubnetConfig -VirtualNetwork "VNET1" ... | |
| + ~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| + CategoryInfo : InvalidArgument: (:) [Get-AzureRmVirtualNetworkSubnetConfig], ParameterBindingException | |
| + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Azure.Commands.Network.GetAzureVirtualNetworkSubnetConfigCommand | 
  
    
      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
    
  
  
    
  | $location='east us2' | |
| $resourceGroup='TEST-RG' | |
| $vmname='TESTVM' | |
| $bootstorageaccount='TESTSTORAGE' | |
| $vhduri= 'https://TESTSTORAGE.blob.core.windows.net/TESTVM.vhd' | |
| $OSDISKNAME = "TESTVMOSDISK" | |
| $size='Standard_D3_v2' | |
| $ip='10.0.1.9' | |
| Select-AzureRmSubscription -SubscriptionName "TEST-RG" | 
  
    
      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
    
  
  
    
  | $vmName="Testvm02" | |
| $vmSize= 'Standard_F8s' | |
| $resourceGroupName="Test-RG" | |
| $vnet="ELNK-UAT-VNET-10.141.0.0" | |
| $location="EAST US 2" | |
| $subnet="Test-Subnet" | |
| $nicname=$vmname + '-NIC' | |
| $ipname=$vmname + '-NIC-IP' | |
| $vhduri = "https://Test.blob.core.windows.net/test.vhd" | |
| $OsdiskName="Test" | 
  
    
      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
    
  
  
    
  | { | |
| "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "vmName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "Name of the VM" | |
| } | |
| }, | 
  
    
      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="test-DR-RG" | |
| $location = "East US2" | |
| $vmname='test-sc-cd02' | |
| #Collecting required parameters for creating VM | |
| $StorageAccountName='testvhdstorage02' | |
| $vnet=Get-AzureRmVirtualNetwork -ResourceGroupName $resourceGroup | |
| $subnetname = $vnet.Subnets.name | |
| $vnetname=$vnet.Name | |
| $subnetid=Get-AzureRmVirtualNetworkSubnetConfig -VirtualNetwork $vnet -Name $subnetname | 
  
    
      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
    
  
  
    
  | New-AzureRmResourceGroup -Name $resourcegroup -Location $location | |
| New-AzureRmVirtualNetwork -ResourceGroupName $resourcegroup -Name VNET1 -Location $location -AddressPrefix 192.168.0.0/16 | |
| $vnet = Get-AzureRmVirtualNetwork -ResourceGroupName $resourcegroup -Name VNET1 | |
| Add-AzureRmVirtualNetworkSubnetConfig -Name $SubnetFront -VirtualNetwork $vnet -AddressPrefix 192.168.1.0/24 | |
| Add-AzureRmVirtualNetworkSubnetConfig -Name $SubnetBack -VirtualNetwork $vnet -AddressPrefix 192.168.2.0/24 | 
  
    
      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 NewPullServer | |
| { | |
| param | |
| ( | |
| [string[]]$ComputerName = ‘vms03’ | |
| ) | |
| Import-DSCResource -ModuleName xPSDesiredStateConfiguration |