dsc

Cannot create a folder on the partition that was just created within a DSC script

此生再无相见时 提交于 2019-12-08 06:46:14
问题 I'm trying to use DSC to format drives and create a certain folder structure on newly formatted drives. Right after I've created a partition, formatted a disk and gave it a drive letter I'm trying to create a folder using the new disk path however I'm receiving Cannot find drive. A drive with the name 'K' does not exist types of errors on New-Item call. This code is an example of one executed within a Script DSC: $someDiskNumber = 3 # for the sake of testing Initialize-Disk -Number

How to upgrade windows service using PowerShell Desired State Configuration

百般思念 提交于 2019-12-08 02:43:21
问题 Below is an example of my config, install works fine but if I replace '\\BuildMachine\Output\MyService.exe' with a newer version DSC fails with file in use errors. What is the correct way to upgrade a windows service using DSC? Thanks. Configuration ServiceTestConfiguration { Import-DscResource -ModuleName PSDesiredStateConfiguration Import-DscResource -ModuleName xPSDesiredStateConfiguration Node localhost { File EnsureLatestServiceExist { Ensure = 'Present' Type = 'File' Checksum =

Powershell DSC Pull Server throws internal error - Microsoft.Isam.Esent.Interop not found

纵饮孤独 提交于 2019-12-07 22:28:12
问题 I've followed the instructions found in Powershell.org's DSC Book to set up an http Pull Server (Windows 2012 server) to use with DSC. I set up the http Pull Server, then crafted a configuration to be pulled, then set up my node's LCM to pull and run the configuration. I can see a Scheduled task on the node under Task Scheduler/Microsoft/Windows/Desired State Configuration , so I know at least something worked. However, my configuration is not being run. When I look at the Event Logs under

The PowerShell provider xWebAdministration does not exist at the PowerShell module path nor is it registered as a WMI provider

人走茶凉 提交于 2019-12-07 18:29:58
问题 I have made this very simple DSC script. Which basically creates web application in default website. Configuration ConfigureWebApp { param ($MachineName) Import-DscResource -Module xWebAdministration Node $MachineName { xWebApplication NewWebApplication { Name = "MyApp" Website = "Default Web Site" WebAppPool = "DefaultAppPool" PhysicalPath = "C:\Inetpub\wwwroot\MyApp" Ensure = "Present" } } } cd "C:\Dsc\scripts" ConfigureWebApp -MachineName "WIN-KPURIN2B87H" When I run generated MOF file, it

Using the File provider in DSC - Ensure Destination only contains files from Source

孤人 提交于 2019-12-07 06:30:30
问题 I've created a DSC resource to copy a Modules directory from a certain source. I'm testing it for a broader deployment in my environment. The resource does a great job ensuring all the files are there and that they match the source content, so far so good... The problem is this; I want to ensure that if there are any additional files in the target, or destination, a folder that they get removed. Here's my code: Configuration TestRun { Param ( $ComputerName = 'Localhost' ) Node $ComputerName {

How do you apply multiple DSC configurations?

假装没事ソ 提交于 2019-12-07 01:50:32
问题 Here's my example: $Config = @{ AllNodes = @( @{ NodeName = 'localhost'; PSDscAllowPlainTextPassword = $True } ) } Configuration LocalAdmin { Param([String[]]$Node='localhost',[PSCredential]$Cred) Import-DscResource -ModuleName 'PSDscResources' Node $Node { User 'LocalAdmin' { Username = 'Admin' Description = 'DSC configuration test' Ensure = 'Present' FullName = 'Administrator Extraordinaire' Password = $Cred PasswordChangeRequired = $False PasswordNeverExpires = $True } Group 'AddToAdmin' {

How do I get feedback about DSC execution on an Azure VM?

蓝咒 提交于 2019-12-06 19:41:35
I just finished the initial tests phase on automating our product release to Azure Virtual Machines using DSC, particularly with the commands described in this article , which are part of the Azure PowerShell SDK. I can push a DSC configuration fine using PowerShell, but since this process is automated, I wanted to get feedback on how the configuration process progressed. When I call Update-AzureVM , I get an ok but the DSC configuration happens after that, asynchronously, and I don't know how it is going unless I log into the machine (or look at the updated Azure Portal which now shows this )

How to upgrade windows service using PowerShell Desired State Configuration

江枫思渺然 提交于 2019-12-06 12:46:16
Below is an example of my config, install works fine but if I replace '\\BuildMachine\Output\MyService.exe' with a newer version DSC fails with file in use errors. What is the correct way to upgrade a windows service using DSC? Thanks. Configuration ServiceTestConfiguration { Import-DscResource -ModuleName PSDesiredStateConfiguration Import-DscResource -ModuleName xPSDesiredStateConfiguration Node localhost { File EnsureLatestServiceExist { Ensure = 'Present' Type = 'File' Checksum = 'ModifiedDate' SourcePath = '\\BuildMachine\Output\MyService.exe' DestinationPath = 'c:\MyService\MyService.exe

The PowerShell provider xWebAdministration does not exist at the PowerShell module path nor is it registered as a WMI provider

穿精又带淫゛_ 提交于 2019-12-06 07:16:44
I have made this very simple DSC script. Which basically creates web application in default website. Configuration ConfigureWebApp { param ($MachineName) Import-DscResource -Module xWebAdministration Node $MachineName { xWebApplication NewWebApplication { Name = "MyApp" Website = "Default Web Site" WebAppPool = "DefaultAppPool" PhysicalPath = "C:\Inetpub\wwwroot\MyApp" Ensure = "Present" } } } cd "C:\Dsc\scripts" ConfigureWebApp -MachineName "WIN-KPURIN2B87H" When I run generated MOF file, it gives me following error. The PowerShell provider xWebAdministration does not exist at the PowerShell

App Pool advanced settings using Powershell Desired Configuration State

北慕城南 提交于 2019-12-05 18:24:01
问题 How can I modify various settings inside either a new or exisitng App Pool using Powershell? I am interesting in some of the "Advanced" settings such as Enable 32-Bit Applications, Managed Pipeline Mode, Process Model Identity, etc. Any ideas on how I can do this? I tried using the xWebAdministration module but that seems to have very basic settings. 回答1: Yes, a custom DSC resource is the only way to do this with DSC. If you are able to use PowerShell scripting without DSC, you can use the