Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
逐字字符串中的Powershell函数调用_Powershell - Fatal编程技术网

逐字字符串中的Powershell函数调用

逐字字符串中的Powershell函数调用,powershell,Powershell,逐字PowerShell字符串中的函数调用是一件事吗 CSharp示例: $"this my { GetSomeValue() }"; 如果不需要,我宁愿不提取变量。我总是这样做: $verbatimString = 'something' + (GetSomeValue) + 'end' 因为它是逐字的字符串,所以不能像您在示例中所展示的那样,使用任何技巧将值直接放入其中。 记住在不使用()的情况下调用函数,您可以在此处阅读:重复。“这是我的$(GetResult($param))”

逐字PowerShell字符串中的函数调用是一件事吗

CSharp示例:

$"this my { GetSomeValue() }"; 

如果不需要,我宁愿不提取变量。

我总是这样做:

$verbatimString = 'something' + (GetSomeValue) + 'end'
因为它是逐字的字符串,所以不能像您在示例中所展示的那样,使用任何技巧将值直接放入其中。 记住在不使用
()
的情况下调用函数,您可以在此处阅读:

重复。“这是我的$(GetResult($param))”