Last active
March 18, 2022 14:29
-
-
Save hurrifan1/e9d31d51409165a9fca1ec5fe3dd0ae1 to your computer and use it in GitHub Desktop.
Update DataTransfer load script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update DataTransfer load script | |
# Location of datasets.json file | |
$ds_path = "C:\ProgramData\Qlik\DataTransfer\DataUpload\storage\datasets.json" | |
# Get file contents as PSObject | |
$ds = Get-Content $ds_path | ConvertFrom-Json -Depth 20 | |
# Narrow to relevant data connection | |
$aws_con = $ds | ? { $_.name -eq "AWS SQL Server test 1" } | |
# Update load statement | |
# $aws_con.loadStatement = '[student demographics]: SELECT "Student_ID" FROM SampleDB.dbo."student demographics";' | |
$aws_con.loadStatement = (Get-Content "C:\Users\Administrator\Desktop\new_load.sql" -Raw).ToString() | |
# Update datasets.json | |
$ds | ConvertTo-Json -Depth 20 | Set-Content $ds_path | |
# Restart the DataTransfer service | |
Get-Service -Name "*DataTransfer*" | Restart-Service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment