使用 PowerShell 加载文件文件?
我想加载一个文件,包含变量的语句。
例如,VLANS.conf
将包含 $VLANS = "VLAN1500", "VLAN877"
如何将其加载到 powershell 中?
I would like to load a file, contains vars' statements.
For example, VLANS.conf
will contain $VLANS = "VLAN1500", "VLAN877"
How do I load it into powershell?
读取文件内容并使用 Invoke-Expression cmdlet 将每一行计算为表达式:
Read the file content and use the Invoke-Expression cmdlet to evaluate each line as an expression: