Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions reference/6/Microsoft.PowerShell.Management/Remove-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Remove-Service [-InputObject <ServiceController>] [-WhatIf] [-Confirm] [<CommonP

The `Remove-Service` cmdlet removes a Windows service in the registry and in the service database.

> This cmdlet was added in PowerShell v6.
The `Remove-Service` cmdlet was introduced in PowerShell 6.0.

## EXAMPLES

Expand All @@ -46,8 +46,8 @@ Remove-Service -Name "TestService"
### Example 2: Remove a service using the display name

This example removes a service named TestService. The command uses `Get-Service` to get an object
that represents the TestService service using the display name. The pipeline operator (|) pipes the
object to `Remove-Service`, which removes the service.
that represents the TestService service using the display name. The pipeline operator (`|`) pipes
the object to `Remove-Service`, which removes the service.

```powershell
Get-Service -DisplayName "Test Service" | Remove-Service
Expand Down Expand Up @@ -124,7 +124,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216).
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down
3 changes: 2 additions & 1 deletion reference/6/Microsoft.PowerShell.Utility/Get-Uptime.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Get-Uptime [-Since] [<CommonParameters>]

This cmdlet returns the time elapsed since the last boot of the operating system.

The `Get-Uptime` cmdlet was introduced in PowerShell 6.0.

## EXAMPLES

### Example 1 - Show time since last boot
Expand Down Expand Up @@ -116,4 +118,3 @@ On Windows, the value returned is the same as the **LastBootUpTime** property of
## RELATED LINKS

[Win32_OperatingSystem](/windows/win32/cimwin32prov/win32-operatingsystem#properties)

62 changes: 39 additions & 23 deletions reference/6/Microsoft.PowerShell.Utility/Remove-Alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
keywords: powershell,cmdlet
locale: en-us
ms.date: 10/17/2018
ms.date: 10/24/2019
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/remove-alias?view=powershell-6&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Remove-Alias
Expand All @@ -11,45 +11,56 @@ title: Remove-Alias
# Remove-Alias

## SYNOPSIS

Remove an alias from the current session.

## SYNTAX

### Default (Default)

```
Remove-Alias [-Name] <String[]> [-Scope <String>] [-Force] [<CommonParameters>]
```

## DESCRIPTION

The `Remove-Alias` cmdlet removes an alias from the current PowerShell session.
You must use the **-Force** parameter to remove any aliases with the **Read-Only** option.
The `Remove-Alias` cmdlet removes an alias from the current PowerShell session. To remove an alias
with the **Option** property set to **ReadOnly**, use the **Force** parameter.

The `Remove-Alias` cmdlet was introduced in PowerShell 6.0.

## EXAMPLES

### Example 1 - Remove an alias

This command removes an alias named `del` that represents the Remove-Item cmdlet.
This example removes an alias named `del` that represents the `Remove-Item` cmdlet.

```powershell
Remove-Alias -Name del
```


### Example 2 - Remove all non-Constant aliases

This command get all aliases except for alias with Constant option and removes them from the current PowerShell session.
This example removes all aliases from the current PowerShell session, except for aliases with the
**Options** property set to **Constant**. After the command is run, the aliases are available in
other PowerShell sessions or new PowerShell sessions.

```powershell
Get-Alias | Where-Object { $_.Options -ne "Constant" } | Remove-Alias -Force
Get-Alias | Where-Object { $_.Options -NE "Constant" } | Remove-Alias -Force
```

`Get-Alias` gets all the aliases in the PowerShell session and sends the objects down the pipeline.
`Where-Object` uses a script block, and the automatic variable (`$_`) and **Options** property
represent the current pipeline object. The parameter **NE** (not equal), selects objects that don't
have an **Options** value set to **Constant**. `Remove-Alias` uses the **Force** parameter to remove
aliases, including read-only aliases, from the PowerShell session.

## PARAMETERS

### -Force

Indicates that the cmdlet removes an alias even if it is read-only.
Even using the **Force** parameter, the cmdlet cannot remove a constant alias.
Indicates that the cmdlet removes an alias, including aliases with the **Option** property set to
**ReadOnly**. The **Force** parameter can't remove an alias with an **Option** property set to
**Constant**.

```yaml
Type: SwitchParameter
Expand All @@ -58,14 +69,14 @@ Aliases:

Required: False
Position: Named
Default value: None
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -Name

Specifies the name of the alias to be removed.
Specifies the name of the alias to remove.

```yaml
Type: String[]
Expand All @@ -81,16 +92,16 @@ Accept wildcard characters: False

### -Scope

Affects only the aliases in the specified scope.
Affects only the aliases in the specified scope. The default scope is **Local**. For more
information, see [about_Scopes](../microsoft.powershell.core/about/about_scopes.md).

The acceptable values for this parameter are:

- Global
- Local
- Script
- A number relative to the current scope (0 through the number of scopes, where 0 is the current scope and 1 is its parent)

Local is the default scope.
For more information, see [about_Scopes](../microsoft.powershell.core/about/about_scopes.md).
- A number relative to the current scope (0 through the number of scopes, where 0 is the current
scope and 1 is its parent)

```yaml
Type: String
Expand All @@ -99,15 +110,17 @@ Aliases:

Required: False
Position: Named
Default value: None
Default value: Local
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand All @@ -119,16 +132,19 @@ You can pipe an alias object to **Remove-Alias**.

### None

This cmdlet does not return any output.
This cmdlet doesn't return any output.

## NOTES

Changes affect only the current scope. To remove an alias from all sessions, add a **Remove-Alias** command to your PowerShell profile.
Changes only affect the current scope. To remove an alias from all sessions, add a **Remove-Alias**
command to your PowerShell profile.

For more information, see [about_Aliases](../microsoft.powershell.core/about/about_aliases.md).

## RELATED LINKS

[about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md)

[Export-Alias](Export-Alias.md)

[Get-Alias](Get-Alias.md)
Expand All @@ -139,4 +155,4 @@ For more information, see [about_Aliases](../microsoft.powershell.core/about/abo

[Set-Alias](Set-Alias.md)


[Where-Object](../Microsoft.PowerShell.Core/Where-Object.md)
9 changes: 5 additions & 4 deletions reference/7/Microsoft.PowerShell.Management/Remove-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Remove-Service [-InputObject <ServiceController>] [-WhatIf] [-Confirm] [<CommonP

The `Remove-Service` cmdlet removes a Windows service in the registry and in the service database.

> This cmdlet was added in PowerShell v6.
The `Remove-Service` cmdlet was introduced in PowerShell 6.0.

## EXAMPLES

Expand All @@ -46,8 +46,8 @@ Remove-Service -Name "TestService"
### Example 2: Remove a service using the display name

This example removes a service named TestService. The command uses `Get-Service` to get an object
that represents the TestService service using the display name. The pipeline operator (|) pipes the
object to `Remove-Service`, which removes the service.
that represents the TestService service using the display name. The pipeline operator (`|`) pipes
the object to `Remove-Service`, which removes the service.

```powershell
Get-Service -DisplayName "Test Service" | Remove-Service
Expand Down Expand Up @@ -124,7 +124,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216).
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down
3 changes: 2 additions & 1 deletion reference/7/Microsoft.PowerShell.Utility/Get-Uptime.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Get-Uptime [-Since] [<CommonParameters>]

This cmdlet returns the time elapsed since the last boot of the operating system.

The `Get-Uptime` cmdlet was introduced in PowerShell 6.0.

## EXAMPLES

### Example 1 - Show time since last boot
Expand Down Expand Up @@ -116,4 +118,3 @@ On Windows, the value returned is the same as the **LastBootUpTime** property of
## RELATED LINKS

[Win32_OperatingSystem](/windows/win32/cimwin32prov/win32-operatingsystem#properties)

Loading