-
Notifications
You must be signed in to change notification settings - Fork 4
Save AcmaObject
Ryan Newington edited this page Sep 4, 2025
·
1 revision
Saves changes made to an ACMA object back to the database. This cmdlet must be called after making any modifications to object attributes to persist the changes.
Save-AcmaObject -AcmaObject <AcmaPSObject> [-ConstructorOverrides <string[]>] [-Events <string[]>]The AcmaPSObject to save to the database
Type: AcmaPSObject
Required: Yes
Position: 1
Accept pipeline input: Yes
An array of constructor names or IDs to force execution, ignoring their normal execution rules
Type: String[]
Required: No
Position: 2
An array of event names to send to the object during the save operation
Type: String[]
Required: No
Position: 3
This cmdlet does not return any output
$person = Get-AcmaObject -ObjectType "person" -AttributeName "accountName" -AttributeValue "jsmith"
$person.displayName = "John Smith"
$person.department = "IT"
Save-AcmaObject $person$person = Add-AcmaObject -ObjectClass "person"
$person.firstName = "Jane"
$person.lastName = "Doe"
Save-AcmaObject $person -ConstructorOverrides @("Generate Account Name", "Set Initial Permissions")$person = Get-AcmaObject -ID "8f495b8d-799e-4eb1-9edf-dbe07fc01464"
$person.accountExpired = $true
Save-AcmaObject $person -Events @("accountExpired")Get-AcmaObject -ObjectType "person" -AttributeName "department" -AttributeValue "Finance" |
ForEach-Object {
$_.costCenter = "CC-FIN-001"
Save-AcmaObject $_
}- Changes to object attributes are not persisted until
Save-AcmaObjectis called - Constructor overrides will force specified constructors to run regardless of their execution rules
- Events can be used to trigger specific business logic during the save operation
- The cmdlet will apply all configured constructors and rules unless overridden