Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update dotnet deps + run formatting on all relevant files + some fixes #1839

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

Open
o-l-a-v wants to merge 35 commits into PowerShell:master
base: master
Choose a base branch
Loading
from o-l-a-v:update-deps-250628

Conversation

@o-l-a-v
Copy link
Contributor

@o-l-a-v o-l-a-v commented Jun 28, 2025
edited
Loading

This PR is just a suggestion on some housekeeping I think is due.

Feel free to close it or ask for changes.

PR Summary

  • Copied settings for VSCode, EditorConfig and Markdownlint from PowerShell/PowerShell.
  • Updated all dotnet deps with dotnet-outdated.
  • Ran formatter on all relevant files with VSCode extension alexr00.formatallfilesinworkspace.
  • Fixed missing dep in perf/benchmark.
  • Use actual cmdlet Install-PSResource of PSResourceGet in setupReleaseTools, not the alias Install-Module.
  • Don't hardcode path seperator char (/ vs \) in build scripts.

PR Context

Why?

  • Keep syntax and style consistent with PowerShell/PowerShell, for both C#, PowerShell and Markdown.
  • Run formatter on all relevant files, so that future PRs that fixes one thing does not show that the whole file changed due to running the formatter.

PR Checklist

@alerickson alerickson mentioned this pull request Jul 15, 2025
14 tasks
Copy link
Member

It looks like the build isn't working in CI for this PR

o-l-a-v reacted with eyes emoji

Copy link
Contributor Author

o-l-a-v commented Jul 16, 2025

It builds fine on my Windows machine. 🤔


Seems GitHub actions builds on Ubuntu 22.04.

Can it (Linux) even target net472?


Why the Windows Server 2022 build fails I don't know.

Copy link
Member

It builds fine on my (Windows) machine as well, but I just pulled in your most recent changes and it's (still) not building on the server. We only build on windows, and then we use that build to test Windows PowerShell on Windows and PowerShell Core on Windows, Mac and Ubuntu.

Could you try opening up a new PR with a subset of these changes? It may help to have a smaller set of changes

Copy link
Contributor Author

o-l-a-v commented Jul 18, 2025

Could we get more output on what/where it fails? dotnet.exe will create log files, right?

Copy link
Member

@adityapatwardhan's change resolved the build issue (just an incorrect file name), but it looks like many of the tests are failing with the same error:

Error parsing server metadata: Could not load file or assembly
| 'System.IO.Pipelines, Version=9.0.0.6, Culture=neutral,
| PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file
| specified.

Copy link
Contributor Author

o-l-a-v commented Aug 8, 2025
edited
Loading

Maybe previous run results are deleted, but the one failed test I can see does not fail when testing manually from Windows PowerShell.

The name of the failed test was misleading though, find resource given CommandName, while it actually was finding module by module name. I updated the name.

Can this be rerun and can I get some logs to see where and what it fails on?

alerickson reacted with thumbs up emoji

Copy link
Member

I think this PR will need to be broken down to smaller PRs to see what's causing this issue:

Find-PSResource: D:\a1円\s\test\FindPSResourceTests\FindPSResourceContainerRegistryServer.Tests.ps1:76
[-] Find all versions of resource when given specific Name, Version not null --> '' 486ms
Line |
Expected a value, but got $null or empty.
76 | ... $res = Find-PSResource -Name $testModuleName -Version "
" -Repos ...
77: $res | Should -Not -BeNullOrEmpty
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at , D:\a1円\s\test\FindPSResourceTests\FindPSResourceContainerRegistryServer.Tests.ps1: line 77
| Error parsing server metadata: Could not load file or assembly 'System.IO.Pipelines, Version=9.0.0.8,
| Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Find-PSResource: D:\a1円\s\test\FindPSResourceTests\FindPSResourceContainerRegistryServer.Tests.ps1:87

o-l-a-v reacted with thumbs up emoji

Copy link
Contributor Author

o-l-a-v commented Oct 3, 2025

It's very slow to troubleshoot when tests don't run on PR automatically. 🫠

Copy link
Contributor Author

o-l-a-v commented Oct 3, 2025

I think it was due to upgrading System.Text.Json from v8 to v9, which requires dotnet 9.

alerickson reacted with thumbs up emoji

Copy link
Member

Unfortunately now the package build is failing:

VERBOSE: Invoking build script
VERBOSE: Starting DoBuild for Microsoft.PowerShell.PSResourceGet with configuration: Release, framework: net472
VERBOSE: Module output file path: 'D:\a1円\s\out\Microsoft.PowerShell.PSResourceGet'
VERBOSE: Module build source path: 'D:\a1円\s\src\code\bin\Release\net472\publish'
VERBOSE: Building assembly and copying to 'D:\a1円\s\out\Microsoft.PowerShell.PSResourceGet'
VERBOSE: dotnet.exe command found in path: C:\hostedtoolcache\windows/dotnet\dotnet.exe
VERBOSE: DotNet version: 8.0.414
VERBOSE: Build location: PSScriptRoot: D:\a1円\s, PWD: D:\a1円\s\src\code
VERBOSE: Starting dotnet build command: dotnet.exe publish --configuration Release --framework net472 --output D:\a1円\s\src\code\bin\Release\net472\publish
VERBOSE: dotnet build failed with error: Build failed with exit code: 1
Invoke-ModuleBuild : Exception calling "Invoke" with "0" argument(s): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: dotnet build failed with error: Build failed with exit code: 1"
At D:\a1円\s\build.ps1:81 char:5
+ Invoke-ModuleBuild -BuildScript $sb
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-ModuleBuild], MethodInvocationException
+ FullyQualifiedErrorId : ActionPreferenceStopException,Invoke-ModuleBuild
##[error]PowerShell exited with code '1'.
Finishing: Build Module

Copy link
Contributor Author

o-l-a-v commented Oct 4, 2025

It builds fine on my machine, using dotnet v8.0.414. Would be helpful with more verbose build logs.

If you don't want to continue with this PR just close it. Would be nice to have it working and merged, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adityapatwardhan adityapatwardhan adityapatwardhan left review comments

@anamnavi anamnavi Awaiting requested review from anamnavi anamnavi is a code owner

@alerickson alerickson Awaiting requested review from alerickson alerickson is a code owner

@SydneyhSmith SydneyhSmith Awaiting requested review from SydneyhSmith SydneyhSmith is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /