Deploy-PersistentApps.ps1

function Deploy-PersistentApps {
    <#
    .SYNOPSIS
    This function ...
 
    .DESCRIPTION
    A bit more description
 
    .PARAMETER FromPipeline
    Shows how to process input from the pipeline, remaining parameters or by named parameter.
 
    .EXAMPLE
    Deploy-PersistentApps 'abc'
 
    Description of the example.
 
    #>


    <# Enable -Confirm and -WhatIf. #>
    [CmdletBinding(SupportsShouldProcess = $true)]
    param(
        [parameter(Mandatory=$false,Position=0)]
    [string]$persistentAppManagerBaseFolder ="c:\qlikEngine",  
    [parameter(Mandatory=$false,Position=1)]
    [string]$persistentAppManagerWebHostAndPort = "http://localhost:3000",
    [parameter(Mandatory=$false,Position=2)]
    [switch]$IncludepersistentAppDefDeploy 
    )

    begin {
    }

    process {
   
  If($IncludepersistentAppDefDeploy.IsPresent){
     Copy-Item -Path C:\Migrate\persistentAppDefs $persistentAppManagerBaseFolder -Recurse -Force
  }

   cd $persistentAppManagerBaseFolder
    node autoDeploy.js
  }

    end {
    }
}

if ($loadingModule) {
    Export-ModuleMember -Function 'Deploy-PersistentApps'
}