You say you have no PowerShell experience, so, it would be prudent that at a minimum you take a quick PowerShell Free Online course to make sure you understand what you can and cannot do and what does and does not work. Assuming / guessing, just will lead you to serious hair pulling and unnecessary stress / bad experiences.
Getting Started with Microsoft PowerShell
Interested in learning PowerShell? This Microsoft PowerShell course is
designed to teach busy IT professionals, admins, and help desk
personnel about how to use PowerShell to improve management
capabilities, automate redundant tasks, and manage the environment in
scale. Through this PowerShell tutorial, you will learn how PowerShell
works and how to make PowerShell work for you from experts Jeffrey
Snover, the
Course Outline
Getting Started with PowerShell Don’t Fear the Shell The Help System &
Getting Connected Extending the Shell Objects for the Admin The
Pipeline: Deeper The Power in the Shell - Automation, Remoting,
Scripting & Toolmaking
https://mva.microsoft.com/en-US/training-courses/getting-started-with-microsoft-powershell-8276?l=r54IrOWy_2304984382
Or use Youtube
https://www.youtube.com/results?search_query=beginning+powershell
You don't traverse the file system the way you are trying to with what you have posted.
Normal file system traversal is via...
# List the full path of the current directory and all child folders
(Get-ChildItem -Path 'D:\MyProject' -Directory -Recurse).FullName
# Only get a specific folder
(Get-ChildItem -Path 'D:\MyProject' -Directory -Recurse -Filter 'Assets').FullName
... then using the Remove-Item cmdlet or by directly navigating the via the full UNC and using the Remove-Item cmdlet.
# Get parameters, example, full and Online help for a cmdlet or function
(Get-Command -Name Remove-Item).Parameters
Get-help -Name Remove-Item -Examples
Get-help -Name Remove-Item -Full
Get-help -Name Remove-Item -Online
I get that you are using Visual Studio, but even, As per MS Docs, ProjectItem.Remove Method..
https://learn.microsoft.com/en-us/dotnet/api/envdte.projectitem.remove?view=visualstudiosdk-2017
And the docs, specifically state what and how it is used.
For the ProjectItem object, removes a project item from the project.
If ProjectItem.ProjectItems is not null — that is, if there's a
subdirectory — then Remove removes all of the project items in that
directory and its subdirectories.
There is no recurse method/option on this one, so you have to do this manually.
This is even covered here:
Cleaning up Visual Studio project folders using PowerShell
Over the years I have created a lot of code samples and demo projects
using Visual Studios. I keep many of these in a single folder which
contains a several subfolders for organizing the code based on the
technology being used. As you open, build and close Visual Studio
projects a lot of additional files and folders get created.
https://blogs.msdn.microsoft.com/rbrundritt/2014/09/18/cleaning-up-visual-studio-project-folders-using-powershell
If you are going the pure Visual Studio way, here is a post that talks to folder enumeration using DTE, then you can take whatever action on it as needed.
How to get folders under projects?
I am trying to get a list of projects and folders under it. I am able
to get the projects and project-items using:
How to get folders under projects?