This example uses the Copy-Item cmdlet to copy the Get-Widget.ps1 script from the\\Server01\Share directory to the \\Server12\ScriptArchive directory. As part of the copyoperation, the command changes the item name from Get-Widget.ps1 to Get-Widget.ps1.txt, so itcan be safely attached to email messages.
When you create your PowerShell cmdlet with notepad, the filename must have a .ps1 extension for example, RunningProcess.ps1. One way of creating such a file is to save your PowerShell commands in notepad, then from the file menu: Save As, Type, All Files, RunningProcess.ps1. Just to be doubly sure, you could put the filename in double quotes, for example: "RunningProcess.ps1". I maybe paranoid, but please check the file is not called RunningProcess.txt or RunningProcess.ps1.txt.
We then keep a .ps1 script in C:\Scripts which we execute via a scheduled task, running under a local user with no privileges other than "Log on as a Batch Job" which is set in the local group policy. The content is attached in the .ps1.txt file. This defines some file paths at the top, including the one to config.js which needs to be established per the canvas-data-cli instructions. Next, there is an array listing (at the time of creation) all possible Canvas tables available for download, with the ones we actually want to download un-commented. The script will download the latest version of the schema file, then will fetch each table indicated, unpack them, replace "\N" characters representing NULL with nothing, then converts line endings for import. At the point of execution of the script, all the downloaded tables are on the server and are ready for import into SQL. 041b061a72