File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,22 @@ if($EcsactSdkInfo) {
133133}
134134"""
135135
136+ def _find_pwsh (rctx ):
137+ pwsh = rctx .which ("pwsh.exe" )
138+ if pwsh :
139+ return pwsh
140+
141+ # rctx.which doesn't work for everything available on Windows. Using cmd's
142+ # built-in 'where' command can find programs installed from the Microsoft
143+ # store or MSIX packages.
144+ cmd = rctx .which ("cmd.exe" )
145+ if cmd :
146+ where_result = rctx .execute ([cmd , "/C" , "where pwsh.exe" ])
147+ if where_result .stdout :
148+ return where_result .stdout
149+
150+ return None
151+
136152def _ecsact_host_repo_impl (rctx ):
137153 is_windows = rctx .os .name .startswith ("windows" )
138154 exe_extension = ""
@@ -144,7 +160,7 @@ def _ecsact_host_repo_impl(rctx):
144160 target_tool_path_runfiles = []
145161
146162 if ecsact_path == None and is_windows :
147- pwsh = rctx . which ( "pwsh.exe" )
163+ pwsh = _find_pwsh ( rctx )
148164 if pwsh == None :
149165 fail ("Cannot find pwsh.exe" )
150166 rctx .file ("FindEcsactSdk.ps1" , _FIND_ECSACT_SDK_PWSH )
You can’t perform that action at this time.
0 commit comments