PoshCode Logo PowerShell Code Repository

test by teste 9 months ago
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/6452"></script>download | new post

test

  1. #region PREREQUISITES
  2.  
  3.     # Variables
  4.     Get-VM
  5.     $password = ConvertTo-SecureString -AsPlainText -Force -String 'Pa$$w0rd'
  6.  
  7.     $iso_X = 'C:\depot\iso_x\en_windows_server_2016_technical_preview_4_x64_dvd_7258292\'
  8.     $VirtualHardDiskPath = (Get-VMHost).VirtualHardDiskPath
  9.  
  10.     # Nano creation module (from WS 2016 ISO)
  11.     Import-Module "C:\NanoServer_TP4\NanoServerImageGenerator.psm1 "
  12.  
  13. #endregion
  14.  
  15. #region  NANO1
  16.  
  17.     # GEN 1 VM (Workgroup)
  18.  
  19.     $nanoName = 'sea-nano11'
  20.     $nanoHardDisk = "$VirtualHardDiskPath\$nanoName.vhd"
  21.  
  22.     if (Test-Path $nanoHardDisk) {
  23.       Get-ChildItem $nanoHardDisk | Remove-Item -Confirm
  24.     }

Submit a correction or amendment below (
click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:


Remember me