CmdID / PowerShell / Cmdlets / Remove
Remove-TypeData
Deletes extended types from the current session. PowerShell reference
From the PowerShell reference 5 parameters
What it does
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.ArrayIdentifyRemove an extended data type from a session
Get-TypeData System.DateTime
(Get-Date).DateTime
Get-TypeData System.DateTime | Remove-TypeData
(Get-Date).DateTimeIdentifyRemove extended types for modules
Get-Module | Remove-TypeDataIdentifyRemove extended types from specified modules
Remove-TypeData -Path "$PSHOME\Modules\PSScheduledJob", "$PSHOME\Modules\PSWorkflow\PSWorkflow.types.ps1xml"IdentifyRemove extended types from a remote session
Invoke-Command -Session $S {Get-TypeData -TypeName CIM | Remove-TypeData}IdentifyIts page in the reference: Remove-TypeData.
Parameters
-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.