< Back
Set-MDTDrive
Post
NAME Set-MDTDrive
SYNOPSIS
Creates an MDT drive.
SYNTAX
Set-MDTDrive [-Name] <Object> [-Path] <Object> [-Confirm] [-Force] [-WhatIf] [<CommonParameters>]
DESCRIPTION
The Set-MDTDrive function creates an MDT drive using the MDTProvider for powershell. This function is actually
just a wrapper for New-PSDrive with the MDTProvider. For example this:
`PS C:>Set-MDTDrive -Name MDTProduction -Path "\\FILESERVER\\MDTProduction$"`
is actually the same command as this:
`PS C:>New-PSDrive -Name MDTProduction -PSProvider MDTProvider -Root "\\FILESERVER\\MDTProduction$" -NetworkPath
"\\FILESERVER\\MDTProduction$" -Scope Global`
PARAMETERS
-Confirm [<SwitchParameter>]
The confirm preference. If left alone, will just let the command run as normal. If $true is specified, will
prompt you before creating the drive.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Force [<SwitchParameter>]
If specified, will create MDT drive even if one with same name already exists(in case one wants to create a
drive of the same name with a different path)
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Name <Object>
Specifies what name you would like to give to the drive you want to create. This is the share name you'll
reference later on when querying the share.
Required? true
Position? 0
Default value
Accept pipeline input? False
Accept wildcard characters? false
-Path <Object>
{{Fill Path Description}}
Required? true
Position? 1
Default value
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
If specified, will output what changes the command will make without making them.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
System.Object
NOTES
Example 1: Create an MDT drive
PS C:\\> Set-MDTDrive -Name MDTProduction -Path "\\\\FILESERVER\\MDTProduction$"
Creates an MDT Drive with a name of `MDTProduction` and a path of `"\\FILESERVER\\MDTProduction$"`
Example 2: Create an MDT drive, overwriting previous drives
PS C:\\> Set-MDTDrive -Name MDTProduction -Path "\\\\FILESERVER\\MDTProduction$" -Force
Creates an MDT Drive with a name of `MDTProduction` and a path of `"\\FILESERVER\\MDTProduction$"`, overwriting any
previous drives with the name `MDTProduction`.
Example 3: Shows what will happen if the command is run
PS C:\\> Set-MDTDrive -Name MDTProduction -Path "\\\\FILESERVER\\MDTProduction$" -WhatIf
Shows what will happen if you try to create an MDT Drive with a name of `MDTProduction` and a path of
`"\\FILESERVER\\MDTProduction$"`
RELATED LINKS
Online Version: https://github.com/JohnForet/MDTApplica ... DTDrive.md
SYNOPSIS
Creates an MDT drive.
SYNTAX
Set-MDTDrive [-Name] <Object> [-Path] <Object> [-Confirm] [-Force] [-WhatIf] [<CommonParameters>]
DESCRIPTION
The Set-MDTDrive function creates an MDT drive using the MDTProvider for powershell. This function is actually
just a wrapper for New-PSDrive with the MDTProvider. For example this:
`PS C:>Set-MDTDrive -Name MDTProduction -Path "\\FILESERVER\\MDTProduction$"`
is actually the same command as this:
`PS C:>New-PSDrive -Name MDTProduction -PSProvider MDTProvider -Root "\\FILESERVER\\MDTProduction$" -NetworkPath
"\\FILESERVER\\MDTProduction$" -Scope Global`
PARAMETERS
-Confirm [<SwitchParameter>]
The confirm preference. If left alone, will just let the command run as normal. If $true is specified, will
prompt you before creating the drive.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Force [<SwitchParameter>]
If specified, will create MDT drive even if one with same name already exists(in case one wants to create a
drive of the same name with a different path)
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Name <Object>
Specifies what name you would like to give to the drive you want to create. This is the share name you'll
reference later on when querying the share.
Required? true
Position? 0
Default value
Accept pipeline input? False
Accept wildcard characters? false
-Path <Object>
{{Fill Path Description}}
Required? true
Position? 1
Default value
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
If specified, will output what changes the command will make without making them.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
System.Object
NOTES
Example 1: Create an MDT drive
PS C:\\> Set-MDTDrive -Name MDTProduction -Path "\\\\FILESERVER\\MDTProduction$"
Creates an MDT Drive with a name of `MDTProduction` and a path of `"\\FILESERVER\\MDTProduction$"`
Example 2: Create an MDT drive, overwriting previous drives
PS C:\\> Set-MDTDrive -Name MDTProduction -Path "\\\\FILESERVER\\MDTProduction$" -Force
Creates an MDT Drive with a name of `MDTProduction` and a path of `"\\FILESERVER\\MDTProduction$"`, overwriting any
previous drives with the name `MDTProduction`.
Example 3: Shows what will happen if the command is run
PS C:\\> Set-MDTDrive -Name MDTProduction -Path "\\\\FILESERVER\\MDTProduction$" -WhatIf
Shows what will happen if you try to create an MDT Drive with a name of `MDTProduction` and a path of
`"\\FILESERVER\\MDTProduction$"`
RELATED LINKS
Online Version: https://github.com/JohnForet/MDTApplica ... DTDrive.md