Search code examples
powershelliiswebdeploy

SkipFolderList argument in Web-Deploy skips more than just the folder


We use WebDeploy to deploy our .Net project. When we would like to deploy the package, there is a certain folder in which we don't want to override the files. I have read in the WebDeploy Powershell Cmdlets documentation that the SkipFolderList argument does just that: it specifies which folders shouldn't be overwritten. However, when we execute the following cmdlet, everything gets skipped, not just the specified folder.

$folderList = @('\\Scripts\Custom\Resources')
Restore-WDPackage $WebApp.Path -skipFolderList $folderList -parameters @{"IIS Web Application Name" = $WebsiteName+"\"+$WebApp.Name}

Are we using the argument wrong? Should the address be specified in a different way?


Solution

  • I found you use the wrong powershell folder parameter "\Scripts\Custom\Resources", if you use this parameter, it will show the "The regular expression '\Scripts\Custom\Resources' is invalid." error.

    I guess this is the reason why you find your depoy command is useless.

    I suggest you could try to use below command, then it will work well.

    $folderList = @('\\Scripts\\Custom\\Resources')
    

    Result:

    enter image description here

    IIS folder: It doesn't add anything.

    enter image description here