| external help file | Wsl-help.xml |
|---|---|
| Module Name | Wsl |
| online version | https://github.com/SvenGroot/WslManagementPS/blob/main/docs/Stop-WslDistribution.md |
| schema | 2.0.0 |
Terminates a WSL distribution.
Stop-WslDistribution [-Name] <String[]> [-Passthru] [-WhatIf] [-Confirm] [<CommonParameters>]
Stop-WslDistribution -Distribution <WslDistribution[]> [-Passthru] [-WhatIf] [-Confirm] [<CommonParameters>]
The Stop-WslDistribution cmdlet terminates a WSL distribution. The distribution to stop can be
specified by name, or piped in from the Get-WslDistribution cmdlet.
This cmdlet wraps the functionality of wsl.exe --terminate.
Stop-WslDistribution "Ubuntu"This example stops the distribution named "Ubuntu".
Stop-WslDistribution "Ubuntu*"This example terminates all distributions whose name starts with "Ubuntu".
Get-WslDistribution -Version 2 | Stop-WslDistribution -PassthruName State Version Default
---- ----- ------- -------
Ubuntu Stopped 2 True
Alpine Stopped 2 False
This example terminates all WSL2 distributions. It uses the Passthru parameter to return the WslDistribution objects for the affected distributions.
Specifies the distribution to be terminated.
Type: WslDistribution[]
Parameter Sets: Distribution
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseSpecifies the name of a distribution to be terminated.
Type: String[]
Parameter Sets: DistributionName
Aliases: DistributionName
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: TrueSpecifies that a WslDistribution object is to be passed through to the pipeline representing the distribution to be shutdown.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalsePrompts 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: FalseShows 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: FalseThis 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.
See Get-WslDistribution for more information.