I built a power shell script to automate adding disk to server 2012 r2 via VMro and VMra. The script runs and correctly adds the disk. The script also runs commands to search for new disk, initialize, assign drive letter and format with NTFS. The issue I am having is when I log onto the server. I can see the disk was added, but not formated. UAC and disk format opens up and ask If I want to allow format to run and the I have to click on format for it to complete. How do I get around this? Below is the script I am running. Note we are running this under a domain admin account.
### import VMware PowerCLI module
### Connect to the vCenter instance
### Retrieve server object
### Add new drive
#region –> Call an invoke to extend the OS with loop (no reboot required)
You are missing ' | ' between commands Initialize-Disk and New-Partition
You must be logged in to reply to this topic.