2

当我尝试使用 DSC 将网站(甚至单个文件)复制到 VM 时,使用以下配置:

    File WebSiteContent {
        Ensure = "Present"              
        SourcePath = "https://MYBLOB.blob.core.windows.net/prod/index.html?sv=2016-05-31&ss=b&srt=s&sp=rl&se=2017-11-29T21:47:36Z&st=2017-07-26T13:47:36Z&spr=https&sig=SIG_HERE"
        DestinationPath = "C:\inetpub\backend\app_data" 
        Type = "Directory"
    }

我收到一个错误:

[ERROR] Relative path is not supported. The related file/directory is: https://MYBLOB.blob.core.windows.net/prod/index.html?sv=2016-05-31&ss=b&srt=s&sp=rl&se=2017-11-29T21:47:36Z&st=2017-07-26T13:47:36Z&spr=https&sig=SIG_HERE. \r\n

不知道是什么原因,因为这是文件的绝对路径。任何使它工作的建议表示赞赏:)

4

1 回答 1

6

您需要使用 xPSDesiredConfiguration 模块中的 xRemoteFile

    File SetupDir {
        Type            = 'Directory'
        DestinationPath = 'c:\Setup'
        Ensure          = "Present"    
    }

    xRemoteFile SQLServerMangementPackage {  
        Uri             = "http://go.microsoft.com/fwlink/?LinkID=824938"
        DestinationPath = "c:\Setup\SSMS-Setup-ENU.exe"
        DependsOn       = "[File]SetupDir"
        MatchSource     = $false
    }
于 2017-07-26T14:06:12.563 回答