I want to save the name of folder into a variable.
$foldername = Get-ItemProperty -Path C:\test* | Select-Object Name
Get-Variable -Name foldername
@{Name=test123}
How can i remove the @{} in the output of the variable?
I want to save the name of folder into a variable.
$foldername = Get-ItemProperty -Path C:\test* | Select-Object Name
Get-Variable -Name foldername
@{Name=test123}
How can i remove the @{} in the output of the variable?
Use Get-ItemPropertyValue
instead of Get-ItemProperty
:
$foldername = Get-ItemPropertyValue -Path C:\test* -Name Name