Skip to content

Conversation

@rwaal
Copy link

@rwaal rwaal commented Apr 13, 2021

This PR adds support for MacOs for the AIPAS IPAM solution.

Changes

Most notable changes are in the README file:

  • Added instructions for installing prerequisites for MacOs. Moved the prereq installation instructions to separate markdown file to keep main README uncluttered.
  • Changed the PowerShell code in the README for cross platform support. Out-GridView is Windows-only, so needed to be replaced. I realise that manually entering a subscriptionId is not as elegant as using Out-GridView, but this at least works on all systems.
  • Replaced the code that writes app settings to environment variables. The original code will not work on Mac and Linux. I choose to write the app settings to the local.settings.json file, which will work on all supported OS'es, and is a common way to store app settings for local development.

tasks.json file:

  • Added alternative commands for MacOs. The original command will only work on Windows. The "osx" commands will automatically be executed on a MacOs system.

rwaal added 9 commits April 13, 2021 21:01
Instructions have been added for MacOs. To keep the README.md file uncluttered, I've moved the prerequisites installation to a separate markdown file.
Removing Out-GridView as it's not cross platform. This change allows the code to work on all PowerShell 7 compatible platforms.
Context will be set using the variable $SubscriptionId, in which user manually entered the subscription Id. Necessary because the Out-Gridview was removed in a previous commit.
Setting the environment variables in the original script doesn't work on MacOs. Instead, a local.settings.json file is used. It provides the same capabilities; storing app settings that the local core tools will use.
The original tasks do not run on macos. These additions are automatically used on macos systems and will run the alternative command.
Local settings should be committed to source control. Especially because there will probably be secrets inside of these files.
@rwaal rwaal marked this pull request as ready for review April 13, 2021 20:22
This was placed before the local.settings.json was in .gitignore and should not have been committed. And for those interested, the SPN is long gone and cannot be used ;-)
[Environment]::SetEnvironmentVariable("AIPASResourceGroupName", $ResourceGroupName, "User")
[Environment]::SetEnvironmentVariable("AIPASStorageAccountName", $StorageAccountName, "User")
# Restart VSCode to have access to the environment variables
#region create local settings file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rwaal

For running the Pester tests located in the IPAM PowerShell Module environment variables are used. So these still need to be created on your local development machine

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

Successfully merging this pull request may close these issues.

2 participants