Relative Content

Tag Archive for powershelllsget-childitemselect-stringforeach-object

PowerShell command to extract `<ProjectReference Include=(…)` from all `.csproj` files in a directory and its subdirectories

Get list of .csproj in directory and subdirectories of D:reposMTest [1] PS D:reposMTest> ls -r -filter “*.csproj” | select Directory, Name Sample output Directory Name ——— —- D:reposMTestM.Common M.Common.csproj D:reposMTestM.Mocks M.Mocks.csproj D:reposMTestM.StateMachines M.StateMachines.csproj Get list of files containing line(s) that match <ProjectReferences*Include=”([^”]+)” in directory and subdirectory [2] PS D:reposMTest> ls | sls ‘<ProjectReferences*Include=”([^”]+)”‘ | ForEach-Object […]