DSCResources/DSC_VMScsiController/en-US/about_VMScsiController.help.txt

.NAME
    VMScsiController
 
.DESCRIPTION
    Manages the SCSI controllers attached to a Hyper-V virtual machine.
 
    When removing a controller, all the disks still connected to the controller
    will be detached.
 
    ## Requirements
 
    * The Hyper-V Role has to be installed on the machine.
    * The Hyper-V PowerShell module has to be installed on the machine.
 
.PARAMETER VMName
    Key - String
    Specifies the name of the virtual machine whose SCSI controller is to be manipulated.
 
.PARAMETER ControllerNumber
    Key - UInt32
    Allowed values: 0, 1, 2, 3
    Specifies the number of the SCSI controller to be set. If not specified, it defaults to 0.
 
.PARAMETER Ensure
    Write - String
    Allowed values: Present, Absent
    Specifies if the SCSI controller should exist or not. If not specified, it defaults to Present.
 
.PARAMETER RestartIfNeeded
    Write - Boolean
    If set to $true then shutdowns and restarts are allowed for the VM when needed for property changes. If not specified, it defaults to $false.
 
.EXAMPLE 1
 
Add a SCSI controller to a VM.
 
configuration Example
{
    param
    (
        [Parameter()]
        [System.String[]]
        $NodeName = 'localhost',
 
        [Parameter(Mandatory = $true)]
        [System.String]
        $VMName,
 
        [Parameter(Mandatory = $true)]
        [System.String]
        $VhdPath
    )
 
    Import-DscResource -ModuleName 'HyperVDsc'
    Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
 
    Node $NodeName
    {
        $diskNameOS = "$VMName-OS.vhdx"
 
        # Install HyperV feature, if not installed - Server SKU only
        WindowsFeature HyperV
        {
            Ensure = 'Present'
            Name = 'Hyper-V'
        }
 
        # Create the VHD for the OS
        VHD DiskOS
        {
            Ensure = 'Present'
            Name = $diskNameOS
            Path = $VhdPath
            Generation = 'vhdx'
            MaximumSizeBytes = 20GB
            DependsOn = '[WindowsFeature]HyperV'
        }
 
        # Create the VM
        VMHyperV NewVM
        {
            Ensure = 'Present'
            Name = $VMName
            VhdPath = Join-Path -Path $VhdPath -ChildPath $diskNameOS
            Generation = 2
            DependsOn = '[VHD]DiskOS'
        }
 
        # Add and additional SCSI controller
        VMScsiController Controller
        {
            Ensure = 'Present'
            VMName = $VMName
            ControllerNumber = 1
            DependsOn = '[VMHyperV]NewVM'
        }
 
    }
}