首页 > 其他 > 详细

DSC配置

时间:2014-03-01 05:32:56      阅读:587      评论:0      收藏:0      [点我收藏+]

#配置Remote Desktop Services服务为 自启动,并运行

Configuration Myservice
{
# A Configuration block can have zero or more Node blocks
Node "localhost"
{
Service ServiceExample
{
Name = "TermService"
StartupType = "Automatic"
State = "Running"
}
}
}

Myservice

Start-DscConfiguration -wait -Verbose -Path .\Myservice

=============================================

#配置目录下文件

Configuration MyWebConfig
{
# A Configuration block can have zero or more Node blocks
Node "localhost"
{
# File is a built-in resource you can use to manage files and directories
# This example ensures files from the source directory are present in the destination directory
File MyFileExample
{
Ensure = "Present" # You can also set Ensure to "Absent"
Type = "Directory“ # Default is “File”
Recurse = $true
#SourcePath = $WebsiteFilePath # This is a path that has web files
SourcePath = "C:\inetpub\wwwroot"
DestinationPath = "C:\inetpub\wwwrootdes" # The path where we want to ensure the web files are present
#DependsOn = "[WindowsFeature]MyRoleExample" # This ensures that MyRoleExample completes successfully before this block runs
}
Log AfterDirectoryCopy
{
# The message below gets written to the Microsoft-Windows-Desired State Configuration/Analytic log
Message = "Finished running the file resource with ID DirectoryCopy"
DependsOn = "[File]MyFileExample" # This means run "DirectoryCopy" first.
}
}
}

MyWebConfig

 

Start-DscConfiguration -wait -Verbose -Path .\MyWebConfig

 

PowerShell内置DSC资源:http://technet.microsoft.com/en-us/library/dn282120.aspx

DSC配置,布布扣,bubuko.com

DSC配置

原文:http://www.cnblogs.com/dreamer-fish/p/3573963.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!