Inclusion of Powershell modules in appref-ms packages #2499

Closed
opened 2026-01-30 22:56:48 +00:00 by claunia · 12 comments
Owner

Originally created by @twoscoopsofpig on GitHub (Jul 3, 2019).

Summary of the new feature/enhancement

In order to use modern authentication with Exchange Online, there is a module in appref-ms format which checks for updated versions of the module before running. The module is not accessible with Import-Module in a regular Powershell console, but can be installed from the Hybrid tab under the Exchange Admin Center of Exchange Online, as described at https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/mfa-connect-to-exchange-online-powershell?view=exchange-ps

I have attempted to add the full path to the appref=ms package as a new profile in Windows Terminal, but receive an error about bad syntax in profiles.json. I assume this is due to the presence of backslashes in the path to the module. Moving the appreff package to a folder in my PATH doesn't seem to make any difference either.

Considering the consolidation goal of this project, it would be useful to include all forms of the Powershell console, regardless of packaging.

Thanks for your attention!

Originally created by @twoscoopsofpig on GitHub (Jul 3, 2019). # Summary of the new feature/enhancement In order to use modern authentication with Exchange Online, there is a module in appref-ms format which checks for updated versions of the module before running. The module is not accessible with Import-Module in a regular Powershell console, but can be installed from the Hybrid tab under the Exchange Admin Center of Exchange Online, as described at https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/mfa-connect-to-exchange-online-powershell?view=exchange-ps I have attempted to add the full path to the appref=ms package as a new profile in Windows Terminal, but receive an error about bad syntax in profiles.json. I assume this is due to the presence of backslashes in the path to the module. Moving the appreff package to a folder in my PATH doesn't seem to make any difference either. Considering the consolidation goal of this project, it would be useful to include all forms of the Powershell console, regardless of packaging. <!-- I expect to be able to use Connect-EXOPS and other cmdlets in the Exchange Online module after modern authentication through MFA. --> Thanks for your attention!
claunia added the Issue-QuestionResolution-Duplicate labels 2026-01-30 22:56:48 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jul 3, 2019):

You'll need to make sure to properly escape the commandline in your profile:

{
  "commandline": "this\will\not\work",
  "commandline": "but\\this\\will"
}

See also #1090

@zadjii-msft commented on GitHub (Jul 3, 2019): You'll need to make sure to properly escape the commandline in your profile: ```json { "commandline": "this\will\not\work", "commandline": "but\\this\\will" } ``` See also #1090
Author
Owner

@twoscoopsofpig commented on GitHub (Jul 3, 2019):

That doesn't work either, much like adding the package to a folder in the
PATH and calling it by the relative filepath didn't work. This is probably
down to the appref-ms packaging, not what that package calls or how it gets
called.

On Wed, Jul 3, 2019 at 8:25 AM Mike Griese notifications@github.com wrote:

You'll need to make sure to properly escape the commandline in your
profile:

{
"commandline": "this\will\not\work",
"commandline": "but\this\will"
}

See also #1090 https://github.com/microsoft/terminal/issues/1090


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/terminal/issues/1785?email_source=notifications&email_token=ALSPBQT762QIVW72WNWCY6LP5SSF7A5CNFSM4H5BIJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZENY7Y#issuecomment-508091519,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALSPBQTEUCLW2WOAXXWY6LDP5SSF7ANCNFSM4H5BIJAQ
.

@twoscoopsofpig commented on GitHub (Jul 3, 2019): That doesn't work either, much like adding the package to a folder in the PATH and calling it by the relative filepath didn't work. This is probably down to the appref-ms packaging, not what that package calls or how it gets called. On Wed, Jul 3, 2019 at 8:25 AM Mike Griese <notifications@github.com> wrote: > You'll need to make sure to properly escape the commandline in your > profile: > > { > "commandline": "this\will\not\work", > "commandline": "but\\this\\will" > } > > See also #1090 <https://github.com/microsoft/terminal/issues/1090> > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/microsoft/terminal/issues/1785?email_source=notifications&email_token=ALSPBQT762QIVW72WNWCY6LP5SSF7A5CNFSM4H5BIJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZENY7Y#issuecomment-508091519>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/ALSPBQTEUCLW2WOAXXWY6LDP5SSF7ANCNFSM4H5BIJAQ> > . >
Author
Owner

@zadjii-msft commented on GitHub (Jul 3, 2019):

Could you share the error you're seeing, and the profile? I'm also fairly sure that you can't try and execute things that in subdirectories of things in your %PATH%, the executable's directory needs to be on %PATH% itself.

@zadjii-msft commented on GitHub (Jul 3, 2019): Could you share the error you're seeing, and the profile? I'm also _fairly_ sure that you can't try and execute things that in subdirectories of things in your `%PATH%`, the executable's directory needs to be on `%PATH%` itself.
Author
Owner

@twoscoopsofpig commented on GitHub (Jul 3, 2019):

It is directly in the path. The error is simply that the requested package
won't open when I try to open it from the new tab dropdown or by hotkey -
the new tab flashes on screen but never populates or stays on screen.

I'm including my profile below. It does use a new GUID, though it reuses
the original icon from the initial Powershell profile.

{
"acrylicOpacity" : 0.5,
"background" : "#012456",
"closeOnExit" : true,
"colorScheme" : "Campbell",
"commandline" : "C:\Users\conantb\Documents\Admin\Microsoft
Exchange Online Powershell Module.appref-ms",
"cursorColor" : "#FFFFFF",
"cursorShape" : "bar",
"fontFace" : "Consolas",
"fontSize" : 10,
"guid" : "{dad46b19-2e01-41cf-b310-e4022c80dbb9}",
"historySize" : 9001,
"icon" :
"ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png",
"name" : "Windows EXOPS PowerShell",
"padding" : "0, 0, 0, 0",
"snapOnInput" : true,
"startingDirectory" : "%USERPROFILE%",
"useAcrylic" : false
}

Please also note that this profile is using the absolute path to the
package, though even after adding C:\users\conantb\Documents\Admin to the
path and referring to the package simply as "Microsoft Exchange Online
Powershell Module.appref-ms" I still see the issue. Further, renaming the
package and using that name fails in a similar manner.

I've also confirmed that calling the package in the path works from the run
box (among other methods).

On Wed, Jul 3, 2019 at 8:56 AM Mike Griese notifications@github.com wrote:

Could you share the error you're seeing, and the profile? I'm also
fairly sure that you can't try and execute things that in
subdirectories of things in your %PATH%, the executable's directory needs
to be on %PATH% itself.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/terminal/issues/1785?email_source=notifications&email_token=ALSPBQTST7HOELIEIX77T2TP5SVZPA5CNFSM4H5BIJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZEQYDA#issuecomment-508103692,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALSPBQWN7KABIYRW2N2NC3LP5SVZPANCNFSM4H5BIJAQ
.

@twoscoopsofpig commented on GitHub (Jul 3, 2019): It is directly in the path. The error is simply that the requested package won't open when I try to open it from the new tab dropdown or by hotkey - the new tab flashes on screen but never populates or stays on screen. I'm including my profile below. It does use a new GUID, though it reuses the original icon from the initial Powershell profile. { "acrylicOpacity" : 0.5, "background" : "#012456", "closeOnExit" : true, "colorScheme" : "Campbell", "commandline" : "C:\\Users\\conantb\\Documents\\Admin\\Microsoft Exchange Online Powershell Module.appref-ms", "cursorColor" : "#FFFFFF", "cursorShape" : "bar", "fontFace" : "Consolas", "fontSize" : 10, "guid" : "{dad46b19-2e01-41cf-b310-e4022c80dbb9}", "historySize" : 9001, "icon" : "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png", "name" : "Windows EXOPS PowerShell", "padding" : "0, 0, 0, 0", "snapOnInput" : true, "startingDirectory" : "%USERPROFILE%", "useAcrylic" : false } Please also note that this profile is using the absolute path to the package, though even after adding C:\users\conantb\Documents\Admin to the path and referring to the package simply as "Microsoft Exchange Online Powershell Module.appref-ms" I still see the issue. Further, renaming the package and using that name fails in a similar manner. I've also confirmed that calling the package in the path works from the run box (among other methods). On Wed, Jul 3, 2019 at 8:56 AM Mike Griese <notifications@github.com> wrote: > Could you share the error you're seeing, and the profile? I'm also > *fairly* sure that you can't try and execute things that in > subdirectories of things in your %PATH%, the executable's directory needs > to be on %PATH% itself. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/microsoft/terminal/issues/1785?email_source=notifications&email_token=ALSPBQTST7HOELIEIX77T2TP5SVZPA5CNFSM4H5BIJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZEQYDA#issuecomment-508103692>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/ALSPBQWN7KABIYRW2N2NC3LP5SVZPANCNFSM4H5BIJAQ> > . >
Author
Owner

@zadjii-msft commented on GitHub (Jul 3, 2019):

Maybe try

"\\\"C:\\Users\\conantb\\Documents\\Admin\\Microsoft Exchange Online Powershell Module.appref-ms\\\""

Escaping spaces is particularly tricky ATM.

@zadjii-msft commented on GitHub (Jul 3, 2019): Maybe try ```json "\\\"C:\\Users\\conantb\\Documents\\Admin\\Microsoft Exchange Online Powershell Module.appref-ms\\\"" ``` Escaping spaces is particularly tricky ATM.
Author
Owner

@twoscoopsofpig commented on GitHub (Jul 3, 2019):

Neither that nor nesting single quotes (escaped or otherwise) works.

When the appref package fires, it runs an updater and then loads the console with the module imported.

@twoscoopsofpig commented on GitHub (Jul 3, 2019): Neither that nor nesting single quotes (escaped or otherwise) works. When the appref package fires, it runs an updater and then loads the console with the module imported.
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 8, 2019):

Ah, this is somewhat worrying. I'm not actually sure how appref-ms modules are supposed to be launched. Let me have a look -- if it's something we can solve with the right powershell command line, this'll turn into general user documentation and advice. If it's something that can't be solved with a command line, we'll need to start asking the hard questions.

@DHowett-MSFT commented on GitHub (Jul 8, 2019): Ah, this is somewhat worrying. I'm not actually sure how `appref-ms` modules are supposed to be launched. Let me have a look -- if it's something we can solve with the right powershell command line, this'll turn into general user documentation and advice. If it's something that can't be solved with a command line, we'll need to start asking the hard questions.
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 8, 2019):

This might just boil down to #492. It looks like appref-ms shortcuts are another type of ClickOnce application, which means their launch must be brokered through another process (internet explorer, windows shell, etc.) Right now, we can't support hooking the launch of another console application through a broker.

@DHowett-MSFT commented on GitHub (Jul 8, 2019): This might just boil down to #492. It looks like `appref-ms` shortcuts are another type of ClickOnce application, which means their launch _must_ be brokered through another process (internet explorer, windows shell, etc.) Right now, we can't support hooking the launch of another console application through a broker.
Author
Owner

@twoscoopsofpig commented on GitHub (Jul 8, 2019):

That rings true for me. Thanks for looking into it! Are there any plans on
the roadmap to support this?

On Sun, Jul 7, 2019, 21:51 Dustin L. Howett (MSFT) notifications@github.com
wrote:

This might just boil down to #492
https://github.com/microsoft/terminal/issues/492. It looks like
appref-ms shortcuts are another type of ClickOnce application, which
means their launch must be brokered through another process (internet
explorer, windows shell, etc.) Right now, we can't support hooking the
launch of another console application through a broker.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/terminal/issues/1785?email_source=notifications&email_token=ALSPBQRPUS37GNPT43BCYFLP6KTSBA5CNFSM4H5BIJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZL2K7I#issuecomment-509060477,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALSPBQUQI5WMPVOCPRRUVPDP6KTSBANCNFSM4H5BIJAQ
.

@twoscoopsofpig commented on GitHub (Jul 8, 2019): That rings true for me. Thanks for looking into it! Are there any plans on the roadmap to support this? On Sun, Jul 7, 2019, 21:51 Dustin L. Howett (MSFT) <notifications@github.com> wrote: > This might just boil down to #492 > <https://github.com/microsoft/terminal/issues/492>. It looks like > appref-ms shortcuts are another type of ClickOnce application, which > means their launch *must* be brokered through another process (internet > explorer, windows shell, etc.) Right now, we can't support hooking the > launch of another console application through a broker. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/microsoft/terminal/issues/1785?email_source=notifications&email_token=ALSPBQRPUS37GNPT43BCYFLP6KTSBA5CNFSM4H5BIJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZL2K7I#issuecomment-509060477>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/ALSPBQUQI5WMPVOCPRRUVPDP6KTSBANCNFSM4H5BIJAQ> > . >
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 8, 2019):

Sure is. Please follow #492 😄

@DHowett-MSFT commented on GitHub (Jul 8, 2019): Sure is. Please follow #492 :smile:
Author
Owner

@twoscoopsofpig commented on GitHub (Jul 8, 2019):

Much appreciated!

On Sun, Jul 7, 2019, 22:27 Dustin L. Howett (MSFT) notifications@github.com
wrote:

Sure is. Please follow #492
https://github.com/microsoft/terminal/issues/492 😄


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/terminal/issues/1785?email_source=notifications&email_token=ALSPBQTE2QS7GHVL2OPSY6DP6KX3PA5CNFSM4H5BIJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZL3U5Y#issuecomment-509065847,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALSPBQX4GISJ364WJQG5TVLP6KX3PANCNFSM4H5BIJAQ
.

@twoscoopsofpig commented on GitHub (Jul 8, 2019): Much appreciated! On Sun, Jul 7, 2019, 22:27 Dustin L. Howett (MSFT) <notifications@github.com> wrote: > Sure is. Please follow #492 > <https://github.com/microsoft/terminal/issues/492> 😄 > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/microsoft/terminal/issues/1785?email_source=notifications&email_token=ALSPBQTE2QS7GHVL2OPSY6DP6KX3PA5CNFSM4H5BIJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZL3U5Y#issuecomment-509065847>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/ALSPBQX4GISJ364WJQG5TVLP6KX3PANCNFSM4H5BIJAQ> > . >
Author
Owner

@ghost commented on GitHub (Jul 9, 2019):

This issue has been marked as duplicate and has not had any activity for 1 day. It will be closed for housekeeping purposes.

@ghost commented on GitHub (Jul 9, 2019): This issue has been marked as duplicate and has not had any activity for **1 day**. It will be closed for housekeeping purposes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2499