1
So habe ich einen Code:Kann in diesem Fall ein Array über PowerShell erstellt werden?
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
}
oder ich sinnlos:
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
und ist es möglich, eine Reihe über Powershell wie so etwas zu machen?
... Was fragst du eigentlich hier? – arco444
Ich meine, wird es richtig sein, diesen Code in etwas mit Array ausgeben? – farag
Es ist weniger Code, wenn Sie es tun, so wahrscheinlich. Grundsätzlich erhalten Sie das gleiche Ergebnis, also hängt es von Ihrem Anwendungsfall ab. – arco444