Remove-Variable 帮助信息

本文介绍PowerShell中的Remove-Variable命令,用于从当前作用域中删除指定变量及其值。文章详细解释了命令的语法、参数及用法,并提供了示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 
如下说明是翻译: help Remove-Variable 产生的帮助信息.
译者: Edengundam(马涛)
 
Remove-Variable
 
大纲
删除变量和该变量的值.
 
语法
Remove-Variable [-name] <string[]> [-include <string[]>] [-exclude <string[]>] [-scope <string>] [-force] [-whatIf] [-confirm] [<CommonParameters>]
 
详细描述
Remove-Variable cmdlet从变量定义的作用域(例如: 当前作用域)删除该变量及其值. 你不能使用此cmdlet删除那些设置为常量的变量或系统变量. 除非你使用Export-Console来保存当前控制台的设置, 否则所有变化只对当前控制台有影响.
 
参数
 
-name <string[]>
指定要删除的变量名称. 参数名称("-Name")可以不出现.
 
强制参数?
true
参数位置?
1
默认值
N/A - 必须指定名称
允许从管道绑定输入?
true (根据属性名)
允许通配符扩展?
true
 
-include <string[]>
只删除指定的项目. 此参数值用于限定Name参数. 输入一个路径元素或模式, 例如"s*"(此参数允许通配符).
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
false
允许通配符扩展?
true
 
-exclude <string[]>
忽略指定的项目. 此参数值用于限定Name参数. 输入一个路径元素或模式, 例如"s*"(此参数允许通配符).
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
false
允许通配符扩展?
true
 
-scope <string>
指定该变量的生存作用域(译者注: 原文此处使用了单词export, 在其他的shell, 一般父进程通过export将变量传递给子进程. ). 此值可以是命名作用域: "global", "local""script", 也可以是一个相对当前作用于的值(此值范围是从0到当前活动的作用域数量. 0代表当前作用域, 1代表父作用域). 默认值为"Local". 更多信息, 请输入"get-help about_scope".
 
强制参数?
false
参数位置?
named
默认值
Local
允许从管道绑定输入?
false
允许通配符扩展?
false
 
-force <SwitchParameter>
在不破坏安全前提下, 能够避免影响命令成功执行的限制条件. 例如: Force参数能够覆盖具有只读属性的文件或创建路径中的必要成分, 但是不会改变人和文件的权限.
 
强制参数?
false
参数位置?
named
默认值
False
允许从管道绑定输入?
false
允许通配符扩展?
false
 
-whatIf
描述执行此命令将会发生的现象, 不会真正执行此命令.
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
false
允许通配符扩展?
false
 
-confirm
执行命令前提示你进行确认.
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
false
允许通配符扩展?
false
 
<公共参数>
此命令支持公共参数: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. 更多信息, 输入, "get-help about_commonparameters".
 
输入类型
Object
 
返回类型
none
 
注意
 
更多信息, 输入"Get-Help Remove-Variable -detailed".需要技术信息, 输入"Get-Help Remove-Variable -full".
 
 如果需要为该命令提供多个参数, 请使用逗号进行分隔. 例如, "<parameter-name> <value1>, <value2>".
 
你可以使用RemoveVariable内建别名"rv".需要更多信息, 查看About_Alias.
 
1
 
C:/PS>remove-variable Smp
 
删除已经存在的变量$Smp
 
相关链接
Set-Variable
Get-Variable
Clear-Variable
New-Variable
 
seqkit seq "$file" -s --id ">$seq_id" -w 100 > output.fasta Error: unknown flag: --id Usage: seqkit seq [flags] Flags: -k, --color colorize sequences - to be piped into "less -R" -p, --complement complement sequence, flag '-v' is recommended to switch on --dna2rna DNA to RNA -G, --gap-letters string gap letters to be removed with -g/--remove-gaps (default "- \t.") -h, --help help for seq -l, --lower-case print sequences in lower case -M, --max-len int only print sequences shorter than or equal to the maximum length (-1 for no limit) (default -1) -R, --max-qual float only print sequences with average quality less than this limit (-1 for no limit) (default -1) -m, --min-len int only print sequences longer than or equal to the minimum length (-1 for no limit) (default -1) -Q, --min-qual float only print sequences with average quality greater or equal than this limit (-1 for no limit) (default -1) -n, --name only print names/sequence headers -i, --only-id print IDs instead of full headers -q, --qual only print qualities -b, --qual-ascii-base int ASCII BASE, 33 for Phred+33 (default 33) -g, --remove-gaps remove gaps letters set by -G/--gap-letters, e.g., spaces, tabs, and dashes (gaps "-" in aligned sequences) -r, --reverse reverse sequence --rna2dna RNA to DNA -s, --seq only print sequences -u, --upper-case print sequences in upper case -v, --validate-seq validate bases according to the alphabet Global Flags: --alphabet-guess-seq-length int length of sequence prefix of the first FASTA record based on which seqkit guesses the sequence type (0 for whole seq) (default 10000) --compress-level int compression level for gzip, zstd, xz and bzip2. type "seqkit -h" for the range and default value for each format (default -1) --id-ncbi FASTA head is NCBI-style, e.g. >gi|110645304|ref|NC_002516.2| Pseud... --id-regexp string regular expression for parsing ID (default "^(\\S+)\\s?") -X, --infile-list string file of input files list (one file per line), if given, they are appended to files from cli arguments -w, --line-width int line width when outputting FASTA format (0 for no wrap) (default 60) -o, --out-file string out file ("-" for stdout, suffix .gz for gzipped out) (default "-") --quiet be quiet and do not show extra information -t, --seq-type string sequence type (dna|rna|protein|unlimit|auto) (for auto, it automatically detect by the first sequence) (default "auto") -j, --threads int number of CPUs. can also set with environment variable SEQKIT_THREADS) (default 4)什么意思
最新发布
08-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值