Previous Next

Thread: Using Msdeploy powershell to archive artifacts

Last post 06-17-2008 10:43 PM by Jamescoo. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 06-17-2008, 7:36 PM

    • ramrao
    • Not Ranked
    • Joined on 06-17-2008, 11:30 PM
    • Posts 1
    • ramrao

    Using Msdeploy powershell to archive artifacts

    I am trying to archive some IIS artifacts( Virtual application, applicaiton pool) using MSdeploy powershell snaping. Below is what i am trying. What is wrong in this?

     From the documentation, I see that I need to use update-DeploymentObject and get-DeploymentObject. I am trying to use something like this  $src=get-deploymentobject -ProviderType manifest custom1.xml  -recurse$dest = get-deploymentobject -ProviderType archiveDir -path C:\temp\wcfmsdeployPsPS C:\Program Files\Microsoft Web Deploy> Update-DeploymentObject -$dest -$srcUpdate-DeploymentObject : A parameter cannot be found that matches parameter name '-Microsoft.Web.Deployment.Commands.PSDeploymentObject'.At line:1 char:24+ Update-DeploymentObject  <<<< -$dest -$src The equivalent command using msdeploy which works ismsdeploy -verb:sync -source:manifest=custom1.xml -dest:archivedir=C:\temp\wcfmsdeployPs  The object created for archiveDir doesn’t seem to be correct. It shows like thisName          : archiveDirAbsolutePath  : archiveDirIsValid       : FalseLastException : Microsoft.Web.Deployment.DeploymentException: The XML file 'C:\temp\wcfmsdeployPs\systemInfo.xml' could not be loaded. ---> System.IO.FileNotFoundException: Could not find file 'C:\temp\wcfmsdeployPs\systemInfo.xml'.                File name: 'C:\temp\wcfmsdeployPs\systemInfo.xml'                   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)                   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)                   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)                   at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials)                   at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)                   at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver)                   at System.Threading.CompressedStack.runTryCode(Object userData)                   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)                   at System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state)                   at System.Xml.XmlTextReaderImpl.OpenUrl()                   at System.Xml.XmlTextReaderImpl.Read()                   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)                   at System.Xml.XmlDocument.Load(XmlReader reader)                   at System.Xml.XmlDocument.Load(String filename)                   at Microsoft.Web.Deployment.ArchiveProvider.GetXmlDocument(String documentPath)                   --- End of inner exception stack trace ---                   at Microsoft.Web.Deployment.ArchiveProvider.GetXmlDocument(String documentPath)                   at Microsoft.Web.Deployment.ArchiveContext.LoadOriginalSystemInfoFromFile()                   at Microsoft.Web.Deployment.ArchiveProvider..ctor(String path)BaseObject    : Microsoft.Web.Deployment.DeploymentObject

     

    Tags:
  • 06-17-2008, 10:43 PM In reply to

    • Jamescoo
    • Not Ranked
    • Joined on 05-01-2008, 9:54 PM
    • Redmond
    • Posts 2
    • Jamescoo

    Re: Using Msdeploy powershell to archive artifacts

    A couple of things that might help is to remove the dash character from -$dest and -$src arguments in the update to look like this:

     Update-deploymentobject $dest $source

    Another thing that you could also try is to specify the directory of your custom.xml because the get-deploymentobject cmdlet when using manifest provider doesn't look under current directory by default.  Try something like:

    Get-deploymentobject manifest c:\location\custom.xml , instead of only custom.xml. 

    Also when in doubt omit the "$src =" to see if the cmdlet returns anything first and then if it is working you can then you can put back the "$src =".

    Let me know if this doesn't solve your issue,

    James

    One step at a time . .. ... ....
Page 1 of 1 (2 items)
Page view counter