小编yan*_*end的帖子

在 Powershell 中使用批处理式环境变量解释字符串

我有一个字符串,其中包含批处理样式表示法 ( %programdata%\App-V) 中的环境变量,我需要在 Powershell 中对其进行评估。可以%ENV%在 Powershell 中轻松评估符号吗?我知道 Powershell 中环境变量的通常表示法是$env:ProgramData,但是字符串是从另一个我无法更改的命令返回给我的。

背景信息:Powershell Cmdlet ( (Get-AppvClientConfiguration -Name PackageInstallationRoot).Value) 奇怪地返回带有批处理样式环境变量 ( %programdata%\App-V)的字符串。

windows powershell batch-file environment-variables appv

3
推荐指数
1
解决办法
116
查看次数