Powershell小技巧之获取变量列表

qq_40893 17 0 PDF 2021-01-16 20:01:48

我们的需求是当想要列出脚本中所有变量。 这里定义了一个函数 Get-Variable: 代码如下: function Get-Variable { $token = $null $errors = $null $ast = [System.Management.Automation.Language.Parser]::ParseInput($psise.CurrentFile.Editor.Text, [ref] $token, [ref] $errors) # not complete, add variables you want to exclude

用户评论
请输入评论内容
评分:
暂无评论