2021-10-08 11:57:29 +00:00
2021-11-10 08:55:01 +00:00
# .\test\powershell\test_MartiLQCkan.ps1 from project root
2021-10-08 11:57:29 +00:00
2021-10-23 11:48:57 +00:00
. . \ source \ powershell \ MartiLQ . ps1
2021-11-28 12:27:57 +00:00
. . \ source \ powershell \ MartiLQResource . ps1
. . \ source \ powershell \ MartiLQUtilities . ps1
2021-10-08 11:57:29 +00:00
2021-12-01 08:03:39 +00:00
$outFile = " .\test\powershell\results\martilq_test_asic.json "
2021-11-10 08:55:01 +00:00
$ckan = Get-Content -Path " .\docs\source\samples\json\asic_ckan_api.json " -Raw
2021-10-08 11:57:29 +00:00
$oMarti = ConvertFrom-Ckan -InputObject $ckan
2021-11-10 08:55:01 +00:00
$x = ConvertTo-Json -InputObject $oMarti -Depth 5
Set-Content -Path $outFile -Value $x
Write-Host " Wrote converted definition to: $outFile "
2021-10-08 11:57:29 +00:00
2021-12-01 08:03:39 +00:00
$outFile = " .\test\powershell\results\martilq_test_covid.json "
2021-10-08 11:57:29 +00:00
$covid_1 = Invoke-WebRequest " https://data.nsw.gov.au/data/api/3/action/package_show?id=793ac07d-a5f4-4851-835c-3f7158c19d15 "
$oMarti = ConvertFrom-Ckan -InputObject $covid_1
$oMarti . description = " This data has been converted from NSW CKAN data source with URL 'https://data.nsw.gov.au/data/api/3/action/package_show?id=793ac07d-a5f4-4851-835c-3f7158c19d15' "
$oMarti . tags + = " ckan "
$oMarti . tags + = " gov "
$oMarti . tags + = " nsw "
$oMarti . publisher = " NSW government (Australia) "
2021-11-10 08:55:01 +00:00
$x = ConvertTo-Json -InputObject $oMarti -Depth 5
Set-Content -Path $outFile -Value $x
Write-Host " Wrote converted definition to: $outFile "
2021-10-08 11:57:29 +00:00
# cases
2021-12-01 08:03:39 +00:00
$outFile = " .\test\powershell\results\martilq_test_covidcases.json "
2021-10-08 11:57:29 +00:00
$covid19 = " https://data.nsw.gov.au/data/api/3/action/package_show?id=3dc5dc39-40b4-4ee9-8ec6-2d862a916dcf "
$covid_2 = Invoke-WebRequest $covid19
$oMarti = ConvertFrom-Ckan -InputObject $covid_2
$oMarti . description = " This data has been converted from NSW CKAN data source with URL ' $covid19 ' "
$oMarti . tags + = " ckan "
$oMarti . tags + = " gov "
$oMarti . tags + = " nsw "
$oMarti . publisher = " NSW government (Australia) "
2021-11-10 08:55:01 +00:00
$x = ConvertTo-Json -InputObject $oMarti -Depth 5
Set-Content -Path $outFile -Value $x
Write-Host " Wrote converted definition to: $outFile "
# AFSL
2021-12-01 08:03:39 +00:00
$outFile = " .\test\powershell\results\martilq_test_afsl.json "
2021-11-10 08:55:01 +00:00
$afsl = " https://data.gov.au/api/3/action/package_show?id=ab7eddce-84df-4098-bc8f-500d0d9776d1 "
$afsl_2 = Invoke-WebRequest $afsl
$oMarti = ConvertFrom-Ckan -InputObject $afsl_2
$oMarti . description = " This data has been converted from DATA GOV AU CKAN data source with URL ' $afsl ' "
$oMarti . tags + = " ckan "
$oMarti . tags + = " gov "
$oMarti . tags + = " au "
$oMarti . publisher = " Australian Securities and Investments Commission (ASIC) "
2021-11-24 11:58:11 +00:00
$oMarti . landingPage = " https://data.gov.au/dataset/ds-dga-ab7eddce-84df-4098-bc8f-500d0d9776d1/details?q=AFS%20Licensee%20Dataset%20extract%20as "
2021-11-10 08:55:01 +00:00
$x = ConvertTo-Json -InputObject $oMarti -Depth 5
Set-Content -Path $outFile -Value $x
Write-Host " Wrote converted definition to: $outFile "
2021-10-08 11:57:29 +00:00
2021-11-10 08:55:01 +00:00
Write-Host " Execution completed "