/
PowerPack tips and examples
PowerPack tips and examples
All PowerPacks scripts must end with Exit-PSScript $Error or they will fail.
Exit-PSScript $Error
How to suppress recording any errors when using PowerShell commands (if supported).
Get-Process -Name 'dummy' -ErrorAction:Ignore
Create Functions - it is recommended to use the “approved” naming convention when creating functions. (Verb-Noun)
# get list of approved verbs
Get-Verb
# simple function example
function Start-InitializeSDK {
$script:cms=New-Object -ComObject "CapaInstaller.SDK"
$script:cms.SetDatabaseSettings($global:databaseserver,$global:database,$false)
Write-Host $script:cms.GetDllVersion()
$script:cms.SetDefaultManagementPoint($global:cmpid)
$script:cms.GetManagementPoints()
$script:cms.SetSplitter("|")
}
When calling Functions never use “( )” parentheses.
How to encrypt passwords.
Join domain.
Enable local administrator account and set password.
, multiple selections available,
Related content
PowerShell Scripting Library
PowerShell Scripting Library
Read with this
PowerPack tips and examples
PowerPack tips and examples
More like this
Intellisense for CMS functions in VS Code
Intellisense for CMS functions in VS Code
Read with this
Using passwords in CapaInstaller Scripting Library
Using passwords in CapaInstaller Scripting Library
More like this
CMS_JobRetryLater
CMS_JobRetryLater
Read with this
Using passwords in CapaInstaller Scripting Library
Using passwords in CapaInstaller Scripting Library
More like this