Import-PowerShellDataFile
从 .. 导入值PSD1 文件不调用其内容
语法
Import-PowerShellDataFile
[[-Path] <String[]>]
[<CommonParameters>]
Import-PowerShellDataFile
[-LiteralPath <String[]>]
[<CommonParameters>]
说明
Import-PowerShellDataFile
cmdlet 返回包含键值对的哈希表。PSD1 文件。
示例
示例 1:从 PSD1 检索值
$content = Import-PowerShellDataFile .\Configuration.psd1
$content
Name Value
---- -----
key1 value1
key2 value2
此示例检索存储在 Configuration.psd1 文件中的哈希表中存储的键值对。
参数
-LiteralPath
要导入的文件的路径。 路径中的所有字符都被视为文本值。 不处理通配符。
类型: | String[] |
别名: | PSPath |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Path
要导入的文件的路径。 允许通配符,但仅导入第一个匹配文件。
类型: | String[] |
Position: | 0 |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | True |