Closed jw15851 closed 4 months ago
Where are you getting the Get-VmsDiskUsage.ps1 script from? I'm not seeing it as part of the samples (unless I'm missing it).
On Fri, Apr 19, 2024 at 4:21 PM Jared Tarter @.***> wrote:
Where are you getting the Get-VmsDiskUsage.ps1 script from? I'm not seeing it as part of the samples (unless I'm missing it).
— Reply to this email directly, view it on GitHub https://github.com/MilestoneSystemsInc/PowerShellSamples/issues/127#issuecomment-2067297876, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJVG7MSPMTNZ64AYV5JWJQTY6GDE7AVCNFSM6AAAAABGLYFDT2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXGI4TOOBXGY . You are receiving this because you authored the thread.Message ID: @.***>
OK, it is what I was suspecting. This script is an older one that used Get-IServerProxyService. That has been removed (about 3 years ago) from MilestonePSTools because it was using unsupported APIs that could (and did) change from version to version making the function completely unreliable.
That script would return something like this for each camera:
The "AvailableSpace" was the total amount of space across any live and archive databases that the camera was assigned to. This is one we could potentially look at updating with supported features but, for now, I'd suggest Get-VmsCameraReport. It obviously returns more data and takes longer but it can be filtered down to return less data (but it won't decrease the time). For example, they could run this command which returns the same information except for the total storage available across the live and archive databases.
Get-VmsCameraReport | Select-Object RecorderName, HardwareName, Name, UsedSpaceInGB, IsStarted | Out-GridView
That will return this:
I updated the Get-VmsCameraDiskUsage function to use supported functionality.
updated PSTools Ran PShell as admin, on a machine with Management Client installed with the DLL at the expected path. loaded script from GitHub: Get-VmsCameraDiskUsage.ps1 issued: Get-Hardware | Get-Camera | Get-VmsCameraDiskUsage | Out-GridView command The result is below: