Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Need assistance on Start-process

$
0
0

I'm using start-process to add appv package. Normal procedure would be using add-appvclientpackage that returns packageid, versionid etc but if add application using start-process i am not getting return code of add-appvclientpackage.

Direct code: $a = add-appvclientpackage C:\applicationname.appv

write-host $a

Result for above command:

PackageId            : 

VersionId            : 

Name                 : 

Version              : 0.0.0.1

Path                 : 

IsPublishedToUser    : False

UserPending          : False

IsPublishedGlobally  : False

GlobalPending        : False

InUse                : False

InUseByCurrentUser   : False

PackageSize          : 

PercentLoaded        : 100

IsLoading            : False

HasAssetIntelligence : False

 But when i add package using below code, i am not getting above return code of appv client.

$a = Start-Process powershell -Credential DOmain\username -ArgumentList '-noprofile -command &{$result = Add-AppvClientPackage C:\applicationname.appv;$result}' `

 -WorkingDirectory C:\windows\System32\WindowsPowerShell\v1.0 -PassThru

 

Can someone help me how can i get return code of add-appvclientpackage using start-process.

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles