Finding the target of a Windows App Execution Alias

From the directory that contains the zero-byte file WT.EXE (for example), this PowerShell command;
Code:
(Get-Item wt.exe).Target
...is supposed to provide me with the target of a Windows App Execution Alias, in this case, WT.EXE

From the directory that contains the zero-byte file WT.EXE, when I try it from TCC;
Code:
pshell /s "(Get-Item wt.exe).Target"
...it returns nothing.

From the directory that contains the zero-byte file WT.EXE, when I try it from PowerShell;
Code:
(Get-Item wt.exe).Target
...it returns nothing.

Well, I discovered (by accident) that it only works with PowerShell Version 7;
Code:
PS C:\Users\Joe Caverly\AppData\Local\Microsoft\WindowsApps> (Get-Item wt.exe).Target
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.12.10732.0_x64__8wekyb3d8bbwe\wt.exe

Important thing to remember, when visiting docs.microsoft.com, is that they default to the current version of the software (PowerShell, in this case), and that if you want to see the docs for a non-current version, you have to select that version yourself.
1650912973251.png


Posting this here mainly for my future reference, but thought others might also find this of interest.

Joe
Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  28.02.18 x64   Windows 10 [Version 10.0.19044.1645]
 
May 30, 2022
26
0
This doesn't work for me, under version 5 of powershell, or the latest preview, 7.3.0-preview4.

The command returns nothing. The only way I have found to locate the target is by using the command "fsutil reparsepoint query wt.exe". You can find information here:


I wrote a perl script to run that command, and convert the output into a more easily understood format.
 
May 30, 2022
26
0
see attached perl script -- newer version now attached
 

Attachments

  • reparse.zip
    528 bytes · Views: 7
  • reparse.zip
    979 bytes · Views: 4
Last edited: