Home Asset Management

Edit Consumable Activity Log with PowerShell

Robin_FaklerRobin_Fakler Customer IT Monkey ✭
edited December 2018 in Asset Management
Hi,
I am able to change the "Available Count" of a consumable with the following PowerShell code:

<div># Get Asset Classes

</div><div>$ClassCon = Get-SCSMClass -Name "Cireson.AssetManagement.Consumable"

</div><div>$AssetName = "Presenter"<br><br></div><div># Asset Available Count -1

</div><div>$Asset = Get-SCSMObject -Class $ClassCon | Where-Object {$_.DisplayName -eq $AssetName}

</div><div>$AssetCount = $Asset.Count

</div><div>$AssetCountMinusOne = $AssetCount - 1

</div><div>$Asset | Set-SCSMObject -Property "Count" -Value $AssetCountMinusOne</div>
Unfortunately there is no entry in the "Activity Log" when I change the value of the "Available Count". Is there a way to write logs with PowerShell?

Thank you!

Best Answer

Answers

Sign In or Register to comment.