To rename a folder in a deployment share using Windows PowerShell

1.   Load the MDT Windows PowerShell snap-in as described in Loading the MDT Windows PowerShell Snap-In.

2.   Ensure that the MDT deployments share Windows PowerShell drives are restored using the Restore-MDTPersistentDrive cmdlet, as shown in the following example:

Restore-MDTPersistentDrive -Verbose

Note   If the MDT deployments that share Windows PowerShell drives are already restored, you will receive a warning message indicating that the cmdlet is unable to restore the drive.

3.   View the list of MDT deployments share Windows PowerShell drives, one for each deployment share, using the Get-PSDrive cmdlet as follows:

Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider

The list of Windows PowerShell drives provided using the MDTProvider are listed, one for each deployment share.

4.   Rename a folder named Windows_8  to Win_8 in the Operating Systems folder in a deployment share using the ren command, as shown in the following example:

ren "DS002:\Operating Systems\Windows_8" "Win_8"

In this example, DS002: is the name of a Windows PowerShell drive returned in step 3.

5.   Verify that the folder is removed correctly by typing the following command:

dir "DS002:\Operating Systems"

The Windows_8 folder is renamed to Win_8.

6.   Rename a folder named Windows_7 to Win-7 in the Operating Systems folder in a deployment share using the Rename-Item cmdlet, as shown in the following example:

Rename-Item "DS002:\Operating Systems\Windows_7" "Win_7"

The cmdlet displays the successful rename of the folder.

7.   Verify that the folder is created correctly by typing the following command:

dir "DS002:\Operating Systems"

The Windows_7 folder is renamed to Win_7.


Related Topics

Managing Deployment Share Folders Using Windows PowerShell