CmdID

CmdID / PowerShell / Cmdlets / Remove

Remove-TypeData

Deletes extended types from the current session. PowerShell reference

From the PowerShell reference 5 parameters

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Deletes extended types from the current session. The Remove-TypeData cmdlet deletes extended type data from the current session. This cmdlet affects only the current session and sessions that are created in the current session. You can add properties and methods to objects in PowerShell by defining them in Update-TypeData commands and Types.ps1xml files. Remove-TypeData deletes those extended properties and methods from the current session. Remove-TypeData does not delete the Types.ps1xml files or delete any extended type definitions from the Types.ps1xml files. For more information about Types.ps1xml files, see about_Types.ps1xml. This cmdlet was introduced in Windows PowerShell 3.0.

Remove-TypeData -TypeData <TypeData> [-WhatIf] [-Confirm] [<CommonParameters>]
Remove-TypeData [-TypeName] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
Remove-TypeData -Path <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]

Remove type data for a specified type

Remove-TypeData -TypeName System.ArrayIdentify

Remove an extended data type from a session

Get-TypeData System.DateTime (Get-Date).DateTime Get-TypeData System.DateTime | Remove-TypeData (Get-Date).DateTimeIdentify

Remove extended types for modules

Get-Module | Remove-TypeDataIdentify

Remove extended types from specified modules

Remove-TypeData -Path "$PSHOME\Modules\PSScheduledJob", "$PSHOME\Modules\PSWorkflow\PSWorkflow.types.ps1xml"Identify

Remove extended types from a remote session

Invoke-Command -Session $S {Get-TypeData -TypeName CIM | Remove-TypeData}Identify

Its page in the reference: Remove-TypeData.

Parameters

5 in the PowerShell reference
-PathSpecifies an array of files that this cmdlet deletes from the session extended type data. This parameter is required. Enter the paths and file names of one or more Types.ps1xml files. Wildcards are not supported. If you omit the path, the default location is the current directory.
-TypeDataSpecifies the type data that this cmdlet deletes from the session. This parameter is required. Enter a variable that contains TypeData objects (System.Management.Automation.Runspaces.TypeData) or a command that gets TypeData objects, such as a Get-TypeData command. You can also pipe TypeData objects to Remove-TypeData.
-TypeNameSpecifies the types that this cmdlet deletes all extended type data for. For types in the System namespace, enter the short name. Otherwise, the full type name is required. Wildcards are not supported. You can pipe type names to Remove-TypeData. When you pipe an object to Remove-TypeData, Remove-TypeData gets the type name of the object and removes all type data for the object type.
-ConfirmPrompts you for confirmation before running the cmdlet.
-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.