From 68a76cd4f4395aa7815cffa9ddb2447732a853b9 Mon Sep 17 00:00:00 2001 From: davidsmatlak Date: Thu, 24 Oct 2019 15:17:39 -0700 Subject: [PATCH] issue 4969 --- .../Remove-Service.md | 9 +-- .../Get-Uptime.md | 3 +- .../Remove-Alias.md | 62 ++++++++++++------- .../Remove-Service.md | 9 +-- .../Get-Uptime.md | 3 +- .../Remove-Alias.md | 62 ++++++++++++------- 6 files changed, 92 insertions(+), 56 deletions(-) diff --git a/reference/6/Microsoft.PowerShell.Management/Remove-Service.md b/reference/6/Microsoft.PowerShell.Management/Remove-Service.md index 30d9781e9f72..dc7510a277a8 100644 --- a/reference/6/Microsoft.PowerShell.Management/Remove-Service.md +++ b/reference/6/Microsoft.PowerShell.Management/Remove-Service.md @@ -31,7 +31,7 @@ Remove-Service [-InputObject ] [-WhatIf] [-Confirm] [ This cmdlet was added in PowerShell v6. +The `Remove-Service` cmdlet was introduced in PowerShell 6.0. ## EXAMPLES @@ -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 @@ -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 diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Uptime.md b/reference/6/Microsoft.PowerShell.Utility/Get-Uptime.md index 5c47fe6f7cf2..8037dcb3c40d 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Uptime.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Uptime.md @@ -30,6 +30,8 @@ Get-Uptime [-Since] [] 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 @@ -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) - diff --git a/reference/6/Microsoft.PowerShell.Utility/Remove-Alias.md b/reference/6/Microsoft.PowerShell.Utility/Remove-Alias.md index 94114733fec7..bf38eeb6112f 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Remove-Alias.md +++ b/reference/6/Microsoft.PowerShell.Utility/Remove-Alias.md @@ -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 @@ -11,45 +11,56 @@ title: Remove-Alias # Remove-Alias ## SYNOPSIS - Remove an alias from the current session. ## SYNTAX +### Default (Default) + ``` Remove-Alias [-Name] [-Scope ] [-Force] [] ``` ## 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 @@ -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[] @@ -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 @@ -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 @@ -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) @@ -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) diff --git a/reference/7/Microsoft.PowerShell.Management/Remove-Service.md b/reference/7/Microsoft.PowerShell.Management/Remove-Service.md index c055609064e5..d836c758c106 100644 --- a/reference/7/Microsoft.PowerShell.Management/Remove-Service.md +++ b/reference/7/Microsoft.PowerShell.Management/Remove-Service.md @@ -31,7 +31,7 @@ Remove-Service [-InputObject ] [-WhatIf] [-Confirm] [ This cmdlet was added in PowerShell v6. +The `Remove-Service` cmdlet was introduced in PowerShell 6.0. ## EXAMPLES @@ -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 @@ -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 diff --git a/reference/7/Microsoft.PowerShell.Utility/Get-Uptime.md b/reference/7/Microsoft.PowerShell.Utility/Get-Uptime.md index 26c7e259ff7f..a1946ee3e31f 100644 --- a/reference/7/Microsoft.PowerShell.Utility/Get-Uptime.md +++ b/reference/7/Microsoft.PowerShell.Utility/Get-Uptime.md @@ -30,6 +30,8 @@ Get-Uptime [-Since] [] 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 @@ -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) - diff --git a/reference/7/Microsoft.PowerShell.Utility/Remove-Alias.md b/reference/7/Microsoft.PowerShell.Utility/Remove-Alias.md index 4032c5e15cd9..58d89316116c 100644 --- a/reference/7/Microsoft.PowerShell.Utility/Remove-Alias.md +++ b/reference/7/Microsoft.PowerShell.Utility/Remove-Alias.md @@ -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-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-Alias @@ -11,45 +11,56 @@ title: Remove-Alias # Remove-Alias ## SYNOPSIS - Remove an alias from the current session. ## SYNTAX +### Default (Default) + ``` Remove-Alias [-Name] [-Scope ] [-Force] [] ``` ## 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 @@ -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[] @@ -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 @@ -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 @@ -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) @@ -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)