Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/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 Azure DSC VM扩展名:$Home目录为什么会更改?_Powershell_Azure_Agent_Dsc - Fatal编程技术网

Powershell Azure DSC VM扩展名:$Home目录为什么会更改?

Powershell Azure DSC VM扩展名:$Home目录为什么会更改?,powershell,azure,agent,dsc,Powershell,Azure,Agent,Dsc,环境:PowerShell版本:5,Windows Server 2016 My DSC在目录中创建Hello World文件: $Home\Desktop 我希望映射到C:\Users\\Desktop。在远程VM的PowerShell上调用$home.desktop,确实会返回桌面目录。但是,当执行DSC本身时,文件将在以下位置创建:C:\Windows\System32\config\systemprofile\Desktop 以下是DSC的副本: Configuration Hello

环境:PowerShell版本:5,Windows Server 2016

My DSC在目录中创建Hello World文件:

$Home\Desktop
我希望映射到
C:\Users\\Desktop
。在远程VM的PowerShell上调用
$home.desktop
,确实会返回桌面目录。但是,当执行DSC本身时,文件将在以下位置创建:
C:\Windows\System32\config\systemprofile\Desktop

以下是DSC的副本:

Configuration HelloWorldConfig 
{
    Import-DscResource –ModuleName 'PSDesiredStateConfiguration'
       Node localhost 
       {
              File TestFile {
                     Ensure = "Present"
                     DestinationPath = "$Home\Desktop\HelloWorld.txt"
                     Contents = "Hello World!"
              }

       }
}

知道为什么会这样吗?也许Azure VM代理是它自己的用户,因此它的
$home
目录不在
C:\Users
,,而是
C:\Windows\System32\config\systemprofile

Azure DSC扩展
Azure VM代理运行,该代理作为
local system
运行,
C:\Windows\System32\config\systemprofile\Desktop
local system
的桌面。

什么是本地系统: