Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add examples in PowerShell #44

Open
ObjectIsAdvantag opened this issue Jan 28, 2020 · 0 comments
Open

add examples in PowerShell #44

ObjectIsAdvantag opened this issue Jan 28, 2020 · 0 comments

Comments

@ObjectIsAdvantag
Copy link
Collaborator

see post in xAPI devs space

I'm running into a bit of a roadblock deploying Macros to the endpoints via the putxml API. I'm using PowerShell to read in the contents of a txt file that contains the JS code using Get-Content. When I insert this into the XML body <Command><Macros><Macro><Save><Name>Testing</Name><Overwrite>True</Overwrite><body>$macroBody</body></Save></Macro></Macros></Command> the result is a giant blob of text. When I POST this it ends up as a single line of text on the endpoint... Which is a problem when you have comments in your JavaScript. Anybody know how I can maintain my line breaks in the import file? Probably a PowerShell thing I need to figure out...

Blah... Yeah, it's a PowerShell thing. Instead of deleting my above post, I will include the solution in case it helps anyone else... When you use Get-Content it will strip carriage returns. Instead, use Get-Content -Raw and the carriage returns will be preserved.
$response | ConvertTo-Json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant