{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/DscResource.Tests/issues/255","repository_url":"https://api.github.com/repos/PowerShell/DscResource.Tests","labels_url":"https://api.github.com/repos/PowerShell/DscResource.Tests/issues/255/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/DscResource.Tests/issues/255/comments","events_url":"https://api.github.com/repos/PowerShell/DscResource.Tests/issues/255/events","html_url":"https://github.com/PowerShell/DscResource.Tests/issues/255","id":343282742,"node_id":"MDU6SXNzdWUzNDMyODI3NDI=","number":255,"title":"Self-Signed Certificate Removed When Used with Modules that Restart AppVeyor","user":{"login":"PlagueHO","id":7589164,"node_id":"MDQ6VXNlcjc1ODkxNjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/7589164?v=4","gravatar_id":"","url":"https://api.github.com/users/PlagueHO","html_url":"https://github.com/PlagueHO","followers_url":"https://api.github.com/users/PlagueHO/followers","following_url":"https://api.github.com/users/PlagueHO/following{/other_user}","gists_url":"https://api.github.com/users/PlagueHO/gists{/gist_id}","starred_url":"https://api.github.com/users/PlagueHO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PlagueHO/subscriptions","organizations_url":"https://api.github.com/users/PlagueHO/orgs","repos_url":"https://api.github.com/users/PlagueHO/repos","events_url":"https://api.github.com/users/PlagueHO/events{/privacy}","received_events_url":"https://api.github.com/users/PlagueHO/received_events","type":"User","site_admin":false},"labels":[{"id":197367714,"node_id":"MDU6TGFiZWwxOTczNjc3MTQ=","url":"https://api.github.com/repos/PowerShell/DscResource.Tests/labels/bug","name":"bug","color":"ee0701","default":true},{"id":197367717,"node_id":"MDU6TGFiZWwxOTczNjc3MTc=","url":"https://api.github.com/repos/PowerShell/DscResource.Tests/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-07-21T00:48:15Z","updated_at":"2018-07-24T08:21:35Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The Self-signed certificate that is used for compiling the Example DSC files is created and the location assigned to `ENV:` variables inside the `Invoke-AppveyorInstallTask`. However, some DSC Resources reboot the AppVeyor container afte the `Invoke-AppveyorInstallTask` runs (e.g. so that some Windows Features can be installed fully). This clears the `ENV:` variables, so that they can no longer be accessed by `Invoke-AppveyorTestScriptTask` (or other code).\r\n\r\nIt is possible to execute `Invoke-AppveyorInstallTask` a second time, after the reboot in the `test_script:` section of the AppVeyor.yml, but this seems counter-intuitive. An alternative would be to move the:\r\n```powershell\r\n    $certificate = New-DscSelfSignedCertificate\r\n    Write-Info -Message ('Created self-signed certificate ''{0}''.' -f $certificate.Subject)\r\n    Write-Info -Message ('$env:DscPublicCertificatePath: {0}' -f $env:DscPublicCertificatePath)\r\n    Write-Info -Message ('$env:DscCertificateThumbprint: {0}' -f $env:DscCertificateThumbprint)\r\n```\r\n\r\ndown into the `Invoke-AppveyorTestScriptTask` function instead."},"comment":{"url":"https://api.github.com/repos/PowerShell/DscResource.Tests/issues/comments/407323346","html_url":"https://github.com/PowerShell/DscResource.Tests/issues/255#issuecomment-407323346","issue_url":"https://api.github.com/repos/PowerShell/DscResource.Tests/issues/255","id":407323346,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzMyMzM0Ng==","user":{"login":"PlagueHO","id":7589164,"node_id":"MDQ6VXNlcjc1ODkxNjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/7589164?v=4","gravatar_id":"","url":"https://api.github.com/users/PlagueHO","html_url":"https://github.com/PlagueHO","followers_url":"https://api.github.com/users/PlagueHO/followers","following_url":"https://api.github.com/users/PlagueHO/following{/other_user}","gists_url":"https://api.github.com/users/PlagueHO/gists{/gist_id}","starred_url":"https://api.github.com/users/PlagueHO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PlagueHO/subscriptions","organizations_url":"https://api.github.com/users/PlagueHO/orgs","repos_url":"https://api.github.com/users/PlagueHO/repos","events_url":"https://api.github.com/users/PlagueHO/events{/privacy}","received_events_url":"https://api.github.com/users/PlagueHO/received_events","type":"User","site_admin":false},"created_at":"2018-07-24T08:21:35Z","updated_at":"2018-07-24T08:21:35Z","author_association":"CONTRIBUTOR","body":"I had a think about this and actually, what might be the best idea is to convert `New-DscSelfSignedCertificate` into an idempotent function `Initialize-DscSelfSignedCertificate`. This function will then be called in both `Invoke-AppveyorInstallTask` and `Invoke-AppveyorTestScriptTask`."}}
{"actor":{"display_login":"PlagueHO"}}