Small yet powerful module for communication with CityLine cloud service server over API from environment of PowerShell7
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-CG
$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
}
* 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
* filter only Park Machine with errors
$pm = Get-CMachine
Get-CLiveMonitoringReport -pmGuids $pm.GUID | Where-Object -Property 'hasError' -Value $true -eq