Does anyone know how to save/pipe the name of a file to a variable using Powershell?
For example, say I have a file c:\temp\test.txt
Is there a way to get "text" (<ideally) or "text.txt" to be stored into a variable that I can use later
I have not had any luck with Get-ChildItem or Get-Content. Thanks!