Skip to content

Instantly share code, notes, and snippets.

View NightOwl888's full-sized avatar

Shad Storhaug NightOwl888

View GitHub Profile
@robatwilliams
robatwilliams / build.targets
Last active March 23, 2022 00:44
Get the names of directories under a specified directory in MSBuild
<PropertyGroup>
<ParentDir>$(MSBuildProjectDirectory)\some\folder</ParentDir><!-- This folder has subfolders folders a, b, c-->
</PropertyGroup>
<Target>
<ItemGroup>
<SubfolderFullPaths Include="$([System.IO.Directory]::GetDirectories('$(ParentDir)'))" />
<SubfolderNames Include="@(SubfolderFullPaths->'$([System.IO.Path]::GetFileName('%(SubfolderFullPaths.Identity)'))')" />
</ItemGroup>