read parameters optionally from $env and $env+_FILE

fixes #6
master
lub 5 years ago
parent d80bfe6435
commit 02a8021a4e

@ -1,15 +1,18 @@
#alternatively read params from $env
#for more flexible Dockerifle support
param ( param (
[Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()]
[uri] [uri]
$HomeServer, $HomeServer = $env:HOMESERVER,
[Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()]
[string] [string]
$UserId, $UserId = $env:USERID,
[Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()]
[securestring] [securestring]
$AccessToken $AccessToken = ((Get-Content -Path $env:ACCESSTOKEN_FILE -Raw).Trim() `
| ConvertTo-SecureString -AsPlainText -Force)
) )
$ErrorActionPreference = 'Stop' $ErrorActionPreference = 'Stop'

Loading…
Cancel
Save