Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build_win2008.ps1 Failing version check #78

Closed
corysabol opened this issue Jan 5, 2017 · 2 comments
Closed

build_win2008.ps1 Failing version check #78

corysabol opened this issue Jan 5, 2017 · 2 comments

Comments

@corysabol
Copy link

Issue Description

The CompareVesrion function fails for me at the exact match check.
This is similar to issue #48 which was closed. However the updated version of the script does not work for me. It could be something weird on my system, not sure.

I did make a small change to the script and got it to work, see below:

function CompareVersions ($actualVersion, $expectedVersion, $exactMatch = $False) {
    If ($exactMatch -eq $True) {
    	Write-Host "Exact Match"
        If ($actualVersion -eq $expectedVersion) {
            return $True
        } else {
            return $False
        }
    }
... snip ...

I simply changed If ($ExactMatch) { to If ($ExactMatch -eq $True) { which fixed the error I was having.

Again, this may just be some quirk on my system in particular, I'm not sure.

Host System

  • OS: Windows 7
  • Packer Version: 0.12.1
  • Vagrant Version: 1.9.1
  • VirtualBox Version: 5.1.12r112440
@infosec-intern
Copy link
Contributor

infosec-intern commented Jan 9, 2017

I'm not a developer on this, but I think line 37 in build_win2008.ps1 has the problem. --exactMatch inside the If conditional sends the string "--exactMatch" to the CompareVersions. I got the script working by removing one of these dashes

You can add Write-Host "Inside exactMatch ($exactMatch)" under line 10 and check to see if this is the problem. If you see something like below, then you and I are running into the same issue:

Actual VBox version: 5.1.12
Expected VBox version: 5.1.10
Inside exactMatch (--exactMatch)

The new edited line should look like
If (CompareVersions -actualVersion $vboxVersion -expectedVersion $virtualBoxMinVersion -exactMatch $False) {

I'll try to make a pull request tonight

@jbarnett-r7
Copy link
Contributor

Thank you for fixing this one @infosec-intern!

usmcfiredog added a commit to usmcfiredog/metasploitable3 that referenced this issue Sep 20, 2020
this is in response to issue rapid7#78 "build_win2008.ps1 Failing version check"
exactMatch sends the string "--exactMatch" to the CompareVersions function instead of $False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants