external help file | Module Name | online version | schema |
---|---|---|---|
Wsl-help.xml |
Wsl |
2.0.0 |
Unregisters a WSL distribution.
Remove-WslDistribution [-Name] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]
Remove-WslDistribution -Distribution <WslDistribution[]> [-WhatIf] [-Confirm] [<CommonParameters>]
The Remove-WslDistribution
cmdlet unregisters a WSL distribution. The distribution to remove can
be specified by name, or piped in from the Get-WslDistribution
cmdlet.
Removing a WSL distribution deletes its file system and all the data it contained.
This cmdlet wraps the functionality of wsl.exe --unregister
.
Remove-WslDistribution Ubuntu
This example unregisters the distribution named "Ubuntu".
Remove-WslDistribution "Ubuntu*"
This example unregisters all distributions whose name starts with "Ubuntu".
Get-WslDistribution -Version 1 | Remove-WslDistribution
This example unregisters all WSL1 distributions.
Get-WslDistribution | Where-Object { $_.Name -ine "Ubuntu" } | Remove-WslDistribution
This example unregisters all distributions except the one named "Ubuntu".
Specifies the distribution to be removed.
Type: WslDistribution[]
Parameter Sets: Distribution
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Specifies the name of a distribution to be removed.
Type: String[]
Parameter Sets: DistributionName
Aliases: DistributionName
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: True
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
You can pipe an object retrieved by Get-WslDistribution
to this cmdlet.
You can pipe a distribution name to this cmdlet.