So I have a code:
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Name .bmp -Type String -Value PhotoViewer.FileAssoc.Bitmap -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Name .jpg -Type String -Value PhotoViewer.FileAssoc.Jpeg -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Name .jpe -Type String -Value PhotoViewer.FileAssoc.Jpeg -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Name .jpeg -Type String -Value PhotoViewer.FileAssoc.Jpeg -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Name .png -Type String -Value PhotoViewer.FileAssoc.Png -Force
and is it possible to make an array via PowerShell like something like this:
ForEach ($type in @(
".bmp"
".jpg"
".jpe"
"jpeg"
".png"
))
{
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Name $type -Type String -Value $something -Force
}
Or i'll be pointless?