Hi,
Creating a default package is ok. We did it.
Set-StrictMode -off
. “_Include\AppDeployToolkit\AppDeployToolkitMain.ps1”
Set-StrictMode -Version Latest
You will have to define some parameters in your main script:
Param (
[Parameter(Mandatory=$True)]
[ValidateSet('Install','Repair','Uninstall', 'MAJ')]
[string]$DeploymentType = 'Install',
[Parameter(Mandatory=$false)]
[ValidateSet('Interactive','Silent','NonInteractive')]
[string]$DeployMode = 'Interactive',
[Parameter(Mandatory=$false)]
[ValidateSet('Inactive','Active')] #Inactive = Ignore l'exclusion du poste, Active=Exclusion active si spécifiée
[Parameter(Mandatory=$false)]
[switch]$AllowRebootPassThru,
#(e.g. SCCM) if detected during an installation. If a 3010 code is passed to SCCM, the SCCM client will display a reboot prompt.
#If set to false, the 3010 return code will be replaced by a “0” (successful, no restart required).
[Parameter(Mandatory=$false)]
[switch]$TerminalServerMode #Changes to user install mode and back to user execute mode for installing/uninstalling applications on
#Remote Destkop Session Host/Citrix servers
)
Those are variables, I am using in standard
[string]$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
set-variable -name var_Scriptactuel -visibility public -Scope Script -Value $MyInvocation.MyCommand.Name
set-variable -name var_ScriptactuelBaseName -visibility public -Scope Script -value ([io.fileinfo]"$var_Scriptactuel").Basename
Set-Variable -Name var_ParametresScriptBase -visibility public -Scope Script -value $null
set-variable -name Var_SourceFiles -visibility public -Scope Script -Value "$scriptDirectory\Sources"
set-variable -name InstTrousses -visibility public -Scope Script -Value "$env:programfiles\Organisation\InstTrousses"
In AppDeployToolkitConfig.xml, you may have to change some variables:
<Toolkit_LogPath>$InstTrousses\Journaux</Toolkit_LogPath>
<Toolkit_LogStyle>CMTrace</Toolkit_LogStyle>
<MSI_LogPath>$InstTrousses\Journaux</MSI_LogPath>
You may have to personnalize some more variables. You have to doing so before loading PSADTK.
Our packages are fully standard
In our main script we are creating some variables necessary to make PSADKT working. Then we are adding a variables file and then PSADTK,
Then you are up and running.
Thanks,