Skip to content

Module for communication with CitiLine cloud service server over API from environment of PowerShell7

Notifications You must be signed in to change notification settings

GamerClassN7/Cityline.Graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cityline.Graph

PowerShell

PowerShell Gallery Downloads GitHub last commit

Small yet powerful module for communication with CityLine cloud service server over API from environment of PowerShell7

Connect to Service

Install-Module Cityline.Graph
Import-Module Cityline.Graph -Force

# create a SecureString first for -Password
$pw = ConvertTo-SecureString 'password' -AsPlainText -Force

# call the function
$session = Connect-CG -Username 'test@test.com' -Password $pw

Disconnect service

Disconnect-CG

Fetch financial report data

$pm = Get-CMachine

Get-CStatisticsAnalysisReport -from (Get-Date -Day 1) -to (Get-Date -Day 30) -pmGuids $pm.GUID -ReportType 'FinancialReport' | ForEach-Object{
    $temp = New-Object PSObject
    foreach ($property in $_.PSObject.Properties.Name) {
        $temp | Add-Member -MemberType 'NoteProperty' -Name ($property -replace 'FinancialReport_', '') -Value $_.$property
    }
    $temp
}

Fetch financial report data

* Search for paied ticket inside CityLine service

$pm = Get-CMachine
Get-CStatisticsDataReport -from (Get-Date -Day 1) -to (Get-Date -Day 30) -pmGuids $pm.GUID -ReportType 'SinglePaymentReport' | Where-Object -Property 'PLATENO' -Value 'XX123YY' -eq
TicketGuid           : 000000-aaaa-bbbb-cccc-dddddddddddd
TYPE_COIN            : 1
guid                 : eeeeeeee-ffff-1111-2222-333333333333
STRTTIME             : 2025-10-29 10:19:38
ENDTIME              : 2025-10-29 12:19:38
DURATION             : 120
PLATENO              : XX123YY
AMTCOIN              : 40.00
MonetaryDenomination : 20.00CZK;20.00CZK
AMTCREDIT            : 
TARIFF               : 
TICKETCODE           : 9999
AMTTOT               : 40.00
pm_name              : Lokalita Alfa
Name                 : Lokalita Alfa
AreaName             : Oblast Alfa
SerialNumber         : 000000
Location             : TestZone
is_coin              : 1
ExportedDateTime     : 2025-10-30 11:57:56
pm_guid              : eeeeeeee-ffff-1111-2222-333333333333

Fetch Park machines Status information

* filter only Park Machine with errors

$pm = Get-CMachine
Get-CLiveMonitoringReport -pmGuids $pm.GUID | Where-Object -Property 'hasError' -Value $true -eq

Info

TODO: Fix when report have only one page

About

Module for communication with CitiLine cloud service server over API from environment of PowerShell7

Resources

Stars

Watchers

Forks

Packages

No packages published