Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.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
Json Powershell调用WebRequest XML数据_Json_Xml_Powershell - Fatal编程技术网

Json Powershell调用WebRequest XML数据

Json Powershell调用WebRequest XML数据,json,xml,powershell,Json,Xml,Powershell,我有一个主要的API请求,我正试图用Powershell将其作为JSON进一步发送到PowerBI。 XML格式如下(但要大得多): 我没有得到任何值,所以我猜它不知道数据在哪里 编辑1 我发现了一些关于如下操作的提示,即在代码末尾显示数据: [ xml ]$fileContents = Get-Content -Path $Result 问题是它似乎不喜欢我试图读取的数据中的第一行,因为它向我抛出了以下错误: Get-Content : Cannot find drive. A drive

我有一个主要的API请求,我正试图用Powershell将其作为JSON进一步发送到PowerBI。 XML格式如下(但要大得多):

我没有得到任何值,所以我猜它不知道数据在哪里

编辑1

我发现了一些关于如下操作的提示,即在代码末尾显示数据:

[ xml ]$fileContents = Get-Content -Path $Result
问题是它似乎不喜欢我试图读取的数据中的第一行,因为它向我抛出了以下错误:

Get-Content : Cannot find drive. A drive with the name '<?xml version="1.0" ?>
获取内容:找不到驱动器。名为“”的驱动器

我通常获取json内容,将其写入一个简单的txt文件,添加所需的行或值,然后将其转换为json


这通常可以让我避免任何类型的问题

我不希望创建任何文件。这些数据每小时可能会被发送到PowerBI云服务4次。当代码运行时,我想获取更多,而不仅仅是adminstatus,但是adminstatus是纯文本的(如上所示),没有人给我任何提示吗?
[ xml ]$fileContents = Get-Content -Path $Result
Get-Content : Cannot find drive. A drive with the name '<?xml version="1.0" ?>