I have pulled some information from the registry using Get-ItemPropertyValue and would like to use this to create a text file with that value.
$Version = (Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name 'DisplayVersion')
Example output - 21H1
Trying to use New-Item with $Version output to create a text file, 21H1.txt
Use your variable in an expandable string, and pass the resulting string value to
New-Item's-Nameparameter