Skip to content

Latest commit

 

History

History
183 lines (164 loc) · 12.9 KB

File metadata and controls

183 lines (164 loc) · 12.9 KB

Saritasa.AppDeploy

Invoke-DesktopProjectDeployment

Synopsis

Deploys the folder contents to a remote computer.

Syntax

Invoke-DesktopProjectDeployment [-Session] <PSSession> [-BinPath] <String> [-DestinationPath] <String> [[-BeforeDeploy] <ScriptBlock>] [[-AfterDeploy] <ScriptBlock>] [[-OverwriteMode] {Backup | Overwrite}] [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
Session true false
BinPath Folder path which contents will be copied over true false
DestinationPath Folder path where the files should be placed true false
BeforeDeploy false false
AfterDeploy false false
OverwriteMode The logic which should be used during copy If set to Backup, the destination folder first will be backed up and then the files will be transferred If set to Overwrite, the destination folder contents will be overwritten with the BinPath fiels false false Backup

Examples

EXAMPLE 1

$s = New-PSSession

PS C:\> Invoke-DesktopProjectDeployment $s -BinPath .\Project\MyProject\bin\Release -DestinationPath C:\inetpub\www\myproject -OverwriteMode [AppDeployOverwriteMode]::Overwrite

In this example, the contents of MyProject\bin\Release folder will be placed on a remote server under myproject folder.
If this folder already exists, the files in it will be replaced with newest version.
Files which do exist in destination folder, but not exist in source folder, will not be deleted.

Invoke-ServiceProjectDeployment

Synopsis

Deploys a service to a remote computer.

Syntax

Invoke-ServiceProjectDeployment [-Session] <PSSession> [-ServiceName] <String> [-ProjectName] <String> [-BinPath] <String> [-DestinationPath] <String> [[-ServiceCredential] <PSCredential>] [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
Session true false
ServiceName Name of deploying service on a remote computer true false
ProjectName The name of executable which should be used to run the service true false
BinPath Folder path containing files which should be deployed true false
DestinationPath Destination path on remote computer true false
ServiceCredential Credentials to be used to create a new service if it does not exist on remote computer false false

Note

User should have 'Log on as a service right (https://technet.microsoft.com/en-us/library/cc739424\(v=ws.10\).aspx\). Local user name example: .\administrator

Service user accounts: LocalService, NetworkService, LocalSystem https://msdn.microsoft.com/en-us/library/windows/desktop/ms686005\(v=vs.85\).aspx

Credentials for built-in service user accounts: New-Object System.Management.Automation.PSCredential('NT AUTHORITY\LocalService', (New-Object System.Security.SecureString)) New-Object System.Management.Automation.PSCredential('NT AUTHORITY\NetworkService', (New-Object System.Security.SecureString)) New-Object System.Management.Automation.PSCredential('.\LocalSystem', (New-Object System.Security.SecureString))

Examples

EXAMPLE 1

$s = New-PSSession

PS C:\> Invoke-ServiceProjectDeployment $s -ServiceName MyWebSite -ProjectName Web -BinPath .\Project\MyWebSite\bin\Release -DestinationPath C:\inetpub\www\MyWebSite