-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix how we reference Special folders (Desktop, Documents) #77
Conversation
$output = @() | ||
$output += "The config file used to generate this submission did not have an AppId defined in it." | ||
$output += "The AppId entry in the config helps ensure that payloads are not submitted to the wrong application." | ||
$output += "Please update your app's StoreBroker config file by adding an ""appId"" property with" | ||
$output += "your app's AppId to the ""appSubmission"" section. If you're unclear on what change" | ||
$output += "needs to be done, you can re-generate your config file using" | ||
$output += " ""New-StoreBrokerConfigFile -AppId $AppId"" -Path ""`$home\desktop\newconfig.json""" | ||
$output += " ""New-StoreBrokerConfigFile -AppId $AppId -Path ""$configPath""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I prefer the back-tick + double quote syntax over 2x double quote because it takes away the need to mentally parse the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair feedback. Will fix.
StoreBroker/Helpers.ps1
Outdated
{ | ||
$global:SBLogPath = $(Join-Path $env:USERPROFILE "Documents\StoreBroker.log") | ||
$global:SBLogPath = (Join-Path -Path $documentsFolder -ChildPath 'StoreBroker.log') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this CR, when we're assigning the result of Join-Path to a variable, we're inconsistent about whether the expression is wrapped in parens or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch. There's no need for that outer parenthesis...I'll remove it.
We previously referenced the Desktop and Documents folders like so: `$home\Documents` and `$home\desktop`, but those folders can be redirected to a different drive (and folder name) without changing the user�s profile directory (e.g. `$home`). Given this, we will use the special method [[System.Environment]::GetFolderPath()](https://msdn.microsoft.com/en-us/library/14tx8hby%28v=vs.110%29.aspx) which can give us the correct path to those ["special folders"](https://msdn.microsoft.com/en-us/library/system.environment.specialfolder(v=vs.110).aspx) (named `MyDocuments` and `Desktop`). This required minor changes to the code and the documentation.
6669d32
to
0eef7be
Compare
We previously referenced the Desktop and Documents folders like so:
$home\Documents
and$home\desktop
, but those folders can beredirected to a different drive (and folder name) without changing
the user�'s profile directory (e.g.
$home
).Given this, we will use the special method
[System.Environment]::GetFolderPath()
which can give us the correct path to those "special folders"
(named
MyDocuments
andDesktop
).This required minor changes to the code and the documentation.