Deletes a variable and its value. (Remove-Variable)

   

# NAME
Remove-Variable

# SYNOPSIS
Deletes a variable and its value.

# SYNTAX
Remove-Variable [-Name] <string[]> [-Exclude <string[]>] [-Force] [-Include <string[]>] [-Scope <string>] [-Confirm] [-WhatIf] [<CommonParameters>]

# DESCRIPTION
The Remove-Variable cmdlet deletes a variable and its value from the scope in which it is defined, such as the current session. You cannot use this cmdlet to delete variables that are set as constants or those that are owned by the system.

# PARAMETERS
-Exclude <string[]>
Omits the specified items. The value of this parameter qualifies the Name parameter. Enter a name element or pattern, such as "s*". Wildcards are permitted.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Force [<SwitchParameter>]
Allows the cmdlet to remove a variable even if it is read-only. Even using the Force parameter, the cmdlet cannot remove a constant.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Include <string[]>
Deletes only the specified items. The value of this parameter qualifies the Name parameter. Enter a name element or pattern, such as "s*". Wildcards are permitted.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Name <string[]>
Specifies the name of the variable to be removed. The parameter name ("Name") is optional.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Scope <string>
Specifies the scope in which this alias is valid. Valid values are "Global", "Local", or "Script", or 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. For more information, see about_Scopes.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm [<SwitchParameter>]
Prompts you for confirmation before executing the command.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf [<SwitchParameter>]
Describes what would happen if you executed the command without actually executing the command.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

# INPUTS
System.Management.Automation.PSVariable
You can pipe a variable object to Remove-Variable.

# OUTPUTS
None
This cmdlet does not return any output.

# NOTES

Changes affect only the current scope, such as a session. To delete a variable from all sessions, add a Remove-Variable command to your Windows PowerShell profile.

You can also refer to RemoveVariable by its built-in alias, "rv". For more information, see about_Aliases.

# EXAMPLE 1

C:\PS>remove-variable Smp

# Description
-----------
This command deletes the $Smp variable.

RELATED LINKS
Online version: http://go.microsoft.com/fwlink/?LinkID=113380
Set-Variable
Get-Variable
Clear-Variable
New-Variable
about_Profiles

C:\Windows>powershell get-help Clear-Variable -full

ColorConsole [Version 1.7.1000] PowerShell 2.0-Export
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2014 Microsoft Corporation.

OS: Windows-10 / Windows-8.1 & 8 / Windows-7 & Vista / Windows Server 2008-2016
»»»» ColorConsole



 


... Home  
... Impressum
... ColorConsole

... CMD
... Netsh-XP
... Netsh-7
... Netsh-Vista
... Powershell





;-)









Download the Windows 7 Starter, Home (Basic Premium), Professional und Ultimate!

... facebook.de
0.092
Gibt es eine Kommandozeilen-Option, um das Programm minimiert zu starten?  / Windows 8 Upgrade von Windows 7, Vista, XP, geht das Updaten?  / Has Q-Dir a single tree that can be used for all panes?  / Wie lange dauert es, bis Windows 10 installiert ist (Download)?  / Help in Windows 8 is missing the old Start menu, how can i activate it?  / I have problems with Aero in Windows 7, how to fix and activate it?  / Warum bewertet Windows 7 meinen PC mit einem Leistungsindex?  / Was ist der Windows Kompatibilitätsmodus?  / Automatisches Ausklappen der Windows-System-Favoriten bei Programmstart in Q-Dir.  / Starten des Geräte-Managers unter Windows 8, 8.1 und Win 10 (öffnen, finden)!  / Wo finde ich die Einstellungen auf Samsung Galaxy?  / Customize the paging file pagefile.sys in Windows 8.1, 8 and 10!  /