Skip to content

Conversation

jazzdelightsme
Copy link
Contributor

"Snapins" aren't really a thing anymore; Import-Module is what we need to do to load the module.

StrictMode is a thing now. Some people use it, some don't, but these scripts were written assuming it was off, so let's make it explicit.

There was no join-string function... don't know if that was something that existed in older PS versions or what.

StrictMode turns certain things into errors like using a variable that
has not been set. For example, with StrictMode on, "$args[0]" will yield
an IndexOutOfRangeException if $args is empty.

These scripts were written assuming that StrictMode was off. Explicitly
turning it off will allow these scripts to run whether or not the user
has turned StrictMode on globally.
@jazzdelightsme
Copy link
Contributor Author

I should mention that with these changes the Enable-OneNote.ps1 import script now works and tests pass (or at least don't generate errors) on Win10/PowerShell 5.1 with StrictMode turned on. (OneNote 2016: 16.0.12624.20348)

@sytone sytone merged commit 66579d9 into sytone:master May 12, 2020
@jazzdelightsme jazzdelightsme deleted the user/danthom/updates branch May 13, 2020 18:54
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