qinking126
qinking126

Reputation: 11895

The term 'xWebsite' is not recognized as the name of a cmdlet

I installed xWebAdministration module. For some reason I am still getting this error message

The term 'xWebsite' is not recognized as the name of a cmdlet"

enter image description here

image url: https://i.sstatic.net/tTwUe.jpg

here's my code.

Configuration MvcWebTest {

    Param(
        [String[]]$ComputerName = "tvw-irwebsvc",
        $AppName = "MvcWebTest",
        $User = "PAOMSvc",
        $Password = "Welcome1",
        $CodePath = "C:\websites\MvcWebTest"

    )

    Import-DscResource -Module xWebAdministration

    Node $ComputerName {

        #Install ASP.NET 4.5
        WindowsFeature ASP {
            Ensure = “Present”
            Name = “Web-Asp-Net45”
        }

        File WebContent {
            Ensure ="Present";
            SourcePath ="\\DVW-MORBAM01\Build\Publish\MvcWebTest\Dev";
            DestinationPath=$CodePath;
            Type = "Directory";
            Recurse = $True
        }

        # Create a new website 
        xWebsite Website { 
            Ensure          = "Present";
            Name            = $AppName;
            State           = "Started";
            PhysicalPath    = $CodePath;
            DependsOn       = "[File]WebContent" 
        } 
    }
}

Upvotes: 1

Views: 1318

Answers (2)

Daniel Mann
Daniel Mann

Reputation: 59035

The screenshot is showing you the problem: The xWebsite resource isn't installed. Only the xwebApplication and xWebVirtualDirectory resources are installed.

I just downloaded the xWebAdministration 1.3.2.3 zip file from Technet, and it looks like someone made a boo-boo -- it's missing xWebSite! The Q&A section is full of people upset about it, so you're not alone. :)

Oddly enough, the Wave 9 resource kit that supposedly includes all the modules has the same problem!

The easiest way to get past this is to just grab version 1.3.2, which looks like it has everything.

Upvotes: 5

Adrian Rodriguez
Adrian Rodriguez

Reputation: 192

To enact the configuration, run the following command:

Start-DscConfiguration -Wait -Verbose -Path .\MvcWebTest

This cmdlet is part of the DSC system. The Wait parameter is optional and makes the cmdlet run interactively. Without this parameter, the cmdlet will create and return a job.

Upvotes: -1

Related Questions