< Back

Rename-MDTApplication

Sat Jan 18, 2020 11:34 am

NAME Rename-MDTApplication



SYNOPSIS

Renames an MDT application.





SYNTAX

Rename-MDTApplication [-Confirm] [-Force] -GUID <Object> -NewName <Object> [-RenameSource] -ShareName <Object>

[-WhatIf] [<CommonParameters>]



Rename-MDTApplication [-Confirm] [-Force] -Name <Object> -NewName <Object> [-RenameSource] -ShareName <Object>

[-WhatIf] [<CommonParameters>]





DESCRIPTION

The Rename-MDTApplication function renames an MDT application, optionally also renaming the source directory if

the applications source files have been imported into MDT. Applications to be renamed can be specified by either

their Name or their GUID.





PARAMETERS

-Confirm [<SwitchParameter>]

The confirm preference. If left alone, will prompt you before modifying each application. If set to $false, it

just goes through.



Required? false

Position? named

Default value $true

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

If specified, disables the checks to verify that 1: the app to be renamed exists and 2: that new name isn't

already in use. Use carefully.



Required? false

Position? named

Default value $false

Accept pipeline input? False

Accept wildcard characters? false



-GUID <Object>

Specifies the GUID of an application to query the MDT share for. Alternate to Name Parameter.



Required? true

Position? named

Default value

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <Object>

Specifies the Name of an application to query the MDT share for. Alternate to GUID Parameter.



Required? true

Position? named

Default value

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-NewName <Object>

Specifies what the new name of the application will be once renamed. Rename-MDTApplication will check the

existing applications to make sure there are no duplicates before making any changes.



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-RenameSource [<SwitchParameter>]

If specified, will also rename the actual application source folder inside of the MDT share. This parameter

will only process if the application has it's source files located within the MDT share(the three MDT app

types are "apps with source files", "apps with sources on network or elsewhere", and "app bundles". this

parameter only processes the first of these three).



Required? false

Position? named

Default value $false

Accept pipeline input? False

Accept wildcard characters? false



-ShareName <Object>

Specifies the name of the MDT share to query. In order to query by name, the MDT share must be mounted using

either New-PSDrive or Set-MDTDrive. Here are some examples that should get you up and running:



`PS C:>New-PSDrive -Name MDTProduction -PSProvider MDTProvider -Root "\\FILESERVER\\MDTProduction$" -NetworkPath

"\\FILESERVER\\MDTProduction$" -Scope Global`



or



`PS C:>Set-MDTDrive -Name MDTProduction -Path "\\FILESERVER\\MDTProduction$"`



Required? true

Position? named

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

System.Object







OUTPUTS

System.Object







NOTES









Example 1: Rename an application



PS C:\\> Rename-MDTApplication -ShareName MDTProduction -Name "APP1" -NewName "APP2"



Renames APP1 to APP2(changes the "Name" and "ShortName" attributes)

Example 2: Rename an application, also renaming it's source directory



PS C:\\> Rename-MDTApplication -ShareName MDTProduction -Name "APP1" -NewName "APP2" -RenameSource



Renames APP1 to APP2, also changing the source directory name from APP1 to APP2(changes the "Name", "ShortName",

"Source", and "WorkingDirectory" attributes, also renaming the source directory itself)

Example 3: Rename an application, also renaming it's source directory



PS C:\\> Rename-MDTApplication -ShareName MDTProduction -Name "APP1" -NewName "APP2" -Force



Renames APP1 to APP2, with the Force parameter disabling the check to see if the application to be renamed exists

in the MDT share, and also the check to see if the New Name is already in use by another MDT application. Use with

caution.



RELATED LINKS

Online Version: https://github.com/JohnForet/MDTApplica ... ication.md