<#
	.Synopsis
		Script for Windows 10 Deployment
	
	.DESCRIPTION
		Script for Windows 10 Deployment
	
	.EXAMPLE
		C:\Setup\Scripts\Update-MDTDS.ps1 -RootMdt 'C:'


	.NOTES
		Created:	 2016-02-26
		Version:	 1.0
		
		Author - Jérôme Bezet-Torres
		Twitter: @JM2K69
		
		Disclaimer:
		This script is provided "AS IS" with no warranties, confers no rights and
		is not supported by the author.
#>

# Check for elevation
[CmdletBinding()]
param
(
	[Parameter(Mandatory = $true,
			   Position = 1)]
	[ValidateSet('C:', 'D:', 'E:', 'F:')]
	$RootMdt = 'C:',
	[Parameter(Mandatory = $true,
			   Position = 2)]
	[ValidateSet('C:', 'D:', 'E:', 'F:')]
	$DSDrive,
	[Parameter(Mandatory = $true,
			   Position = 3)]
	[ValidateSet('DS001', 'DS002', 'DS003')]
	$PSDrive,
	[Parameter(Mandatory = $true,
			   Position = 4)]
	$FolderName
)

If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
    [Security.Principal.WindowsBuiltInRole] "Administrator"))
{
    Write-Warning "Oupps, you need to run this script from an elevated PowerShell prompt!`nPlease start the PowerShell prompt as an Administrator and re-run the script."
	Write-Warning "Aborting script..."
    Break
}

#Set Variables
$COMPUTERNAME = $Env:COMPUTERNAME

Import-Module "$RootMdt\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1"
New-PSDrive -Name $PSDrive -PSProvider MDTProvider -Root "$DSDrive\$FolderName"
Update-MDTDeploymentShare -path "$PSDrive`:"