Skip to content
This repository was archived by the owner on Feb 24, 2021. It is now read-only.
This repository was archived by the owner on Feb 24, 2021. It is now read-only.

Unable to run locally without setting environment variables #28

Description

To be able to run this locally the environment variables need to be set to mimic the behavior of AppVeyor.

I ended up creating a script Start-Build.ps1 in the root folder that sets the variables before running Invoke-Build.
This is not an optimal idea since this script generate a varning in the unit test that Invoke-Build is an alias, and should be change to point to the full script path 'C:\Program Files\WindowsPowerShell\Modules\InvokeBuild\3.6.4\Invoke-Build.ps1'. Since the version can change, it's not possible to change to the full path.

$env:TenantID = '<guid>'
$env:SubscriptionID = '<guid>'
$env:ApplicationID = '<guid>'
$env:ApplicationPassword = '<key/password>'
$env:Location = 'westeurope' # Used by @PlagueHO's branch (PR #21).

$env:BuildFolder = $PSScriptRoot
$env:ProjectName = Split-Path -Path $PSScriptRoot -Leaf
$env:ProjectID = New-Guid # This is used to create a folder in $env:TEMP.
$env:BuildID = 1001 # Any number

Invoke-Build -File .\DscConfiguration.Tests\.build.ps1 -Summary

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions