Hi, I installed a xwebAdministration module from powershell gallery and used the xWebsite example with minor changes. When I tried to run the script it resulted to this:
The command Test-TargetResource of the PS module MSFT_xWebsite does not implement the write property
EnabledProtocols mentioned in the corresponding MOF schema file C:\Program
Files\WindowsPowerShell\Modules\xWebAdministration\DscResources\MSFT_xWebsite\MSFT_xWebsite.schema.mof. All write
paramenters mentioned in the schema file must be implemented by the command Test-TargetResource.
+ CategoryInfo : InvalidOperation: (root/Microsoft/…gurationManager:String) , CimException
+ FullyQualifiedErrorId : WriteParameterNotImplemented
+ PSComputerName : localhost
Here’s my script below:
Configuration webSetup
{
param
(
# Target nodes to apply the configuration
[string]$NodeName = ‘localhost’,
# Name of the website to create
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[String]$WebSiteName,
# Create a protocol
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[String]$Protocol,
# Create a port
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[String]$Port,
# Create an IP Address
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[String]$IPAdd,
# Create an Application Pool
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[String]$AppPool
)
# Import the module that defines custom resources
Import-DscResource -Module xWebAdministration
Node $NodeName
{
# Install the IIS role
WindowsFeature IIS
{
Ensure = "Present"
Name = "Web-Server"
}
# Install the ASP .NET 4.5 role
WindowsFeature AspNet45
{
Ensure = "Present"
Name = "Web-Asp-Net45"
}
# Create the new Website
xWebsite NewWebsite
{
Ensure = "Present"
Name = $WebSiteName
State = "Started"
PhysicalPath = "C:\inetpub\wwwroot"
ApplicationPool = $AppPool
BindingInfo = @(
MSFT_xWebBindingInformation
{
Protocol = $Protocol
Port = $Port
IPAddress = $IPAdd
})
}
}
}
webSetup
Start-DscConfiguration -Force -Wait -Verbose -Path .\webSetup