Reload-PersistentApps.ps1

function Reload-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
    Reload-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 autoReload.js

    
  }

    end {
    }
}

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