More on version numbers and ranges at semver. ( npm install semver to use it yourself.) Version must be parseable by node-semver, which is bundled with npm as a dependency. Ī name can be optionally prefixed by a scope, e.g. You may want to check the npm registry to see if there's something by that name already, before you get too attached to it.
$compareToFile = (Get-Content $compareToPath -Raw) -split "`r`n`r`n" | Sort-Object If you want to see the specific differences just don't rejoin the array and use Compare-Object: $liveKey = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\' #The live key you want to compare $liveFile -eq $compareToFile #This will return True if they are the same, $false if they are different. $liveFile = ((Get-Content $livePath -Raw) -split "`r`n`r`n" | Sort-Object) -join "`r`n`r`n" $compareToFile = ((Get-Content $compareToPath -Raw) -split "`r`n`r`n" | Sort-Object) -join "`r`n`r`n"
$compareToPath = 'C:\temp\compareTo.reg' #The. $livePath = 'C:\temp\live.reg' #Temporary location for the exported reg file reg files, that doesn't help when it comes to automating like I was trying to do.Īfter a fair amount of playing around in PowerShell I found a solution that works quite well: $liveKey = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\' #The live key you want to compare While some advanced GUI tools might be able to sort it out and do a comparison regardless of the order of the reg keys in the. So the files may have been effectively identical, a string comparison on the raw file showed that they were different. reg file to current values in the registry using PowerShell, but the problem I was having was that exporting registry keys for the comparison didn't always export them in the same order that they were in the. I realize this is an old post, but I'm hoping this might help someone.