Edit Consumable Activity Log with PowerShell
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>
Thank you!
Best Answer
-
Justin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭You have to add comments with a type projection. The attached script should get you there.1
Answers
Hi
@Justin_Workman
How can u utilize the decrease and increase task that is available on consumable form. I would like to use powershell to get to these tasks. If not the solution above is good enough
THX
@Robert_Osterberg - Maybe I'm not sure what you mean. This powershell is being used to replace the task.
@Justin_Workman that is all OK thx for answering