Open p0lyMth opened 1 month ago
Which version of PowerShell are you using? "Windows PowerShell" (powershell.exe
), version 5? Or PowerShell "Core" (pwsh.exe
), version 7+/? (you can find this with $PSVersionTable.PSVersion
)
@zadjii-msft, I am using Windows PowerShell version 5:
Major Minor Build Revision
----- ----- ----- --------
5 1 22621 3672
Well yep that explains it. You need to use PowerShell 7+.
I'll convert this issue to "the powershell module should display an error if you try to import it in Powershell 5"
I've installed PowerShell 7+. So I reattempted these commands:
Import-Module .\tools\OpenConsole.psm1
Set-MsBuildDevEnvironment
Invoke-OpenConsoleBuild
When I use Import-Module .\tools\OpenConsole.psm1
, it works fine. However, Set-MsBuildDevEnvironment
returns
Import-Module: The specified module '\Common7\Tools\Microsoft.VisualStudio.DevShell.dll' was not loaded because no valid module file was found in any module directory.
. I've included to my environment variables C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
and C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\
for MSBuild. But, still, I don't know why the above error is happening.
Invoke-OpenConsoleBuild
returns
Error parsing solution file at C:\Users\<user>\Desktop\v1-logic\options-tactical\eng-cmp--dev_sec_ops\.desktop-instance\4-projects-workflow\dev_sec_ops__native\_terminal\OpenConsole.sln: Exception has been thrown by the target of an invocation.
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
msbuild.exe: The term 'msbuild.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Windows Terminal version
1.20.11381.0
Windows build number
10.0.22631.0
Other Software
No response
Steps to reproduce
Under Developer Guidance, I made sure that I had the prerequisites:
I updated the repository with
git submodule update --init --recursive
In Powershell,
Import-Module .\tools\OpenConsole.psm1
works since I updated the Execution policy for my LocalMachine to run scripts. However,Set-MsBuildDevEnvironment
andInvoke-OpenConsoleBuild
don't work and return aCommandNotFoundException
.Expected Behavior
The following commands from Building the Code should build the application
Actual Behavior
Instead both return: