I'm trying to follow this guide to test Django on Azure: https://github.com/carltongibson/rest-framework-tutorial/blob/master/docs/azure/2-appservice.md , however i'm stuck at running the following command since i'm doing it from PowerShell:
$ export $(grep -v '^#' .azure-env | xargs)
What would the command be in PowerShell and can someone explain what it does ?
Thanks
The description of the shell command is already in the document that you provide.
$ export $(grep -v '^#' .azure-env | xargs)
This uses grep to go through your .azure-env file excluding any lines that are comments, passing any values into
xargs
so they will be formatted to be interpreted by the shell. We then export these so they´re passed as environment variables to the commands we envoke.
And you can convert the shell command into PowerShell like this:
Get-Content .\azure.txt | Select-String -NotMatch "^#" | ForEach-Object {
$array= $_[0].ToString().split("=")
[System.Environment]::SetEnvironmentVariable($array[0], $array[1])
}
The screenshot of the result shows here:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With