hashicorp/vagrant · error · Vagrant::Errors::PowerShellInvalidVersion
The version of powershell currently installed on this host i
Error message
The version of powershell currently installed on this host is less than
the required minimum version. Please upgrade the installed version of
powershell to the minimum required version and run the command again.
Installed version: %{installed_version}
Minimum required version: %{minimum_version} What it means
In the same validate_install! path, after confirming PowerShell exists, its major version (version.to_i) is compared against MINIMUM_REQUIRED_VERSION = 3; older versions such as PowerShell 2.0 (the default on Windows 7 / Server 2008 R2) raise PowerShellInvalidVersion with the installed and minimum versions in the message.
Source
Thrown at lib/vagrant/util/powershell.rb:248
rescue Vagrant::Util::Subprocess::TimeoutExceeded
LOGGER.debug("Timeout exceeded while attempting to determine version of Powershell.")
end
@_powershell_version = version
end
@_powershell_version
end
# Validates that powershell is installed, available, and
# at or above minimum required version
#
# @return [Boolean]
# @raises []
def self.validate_install!
if !defined?(@_powershell_validation)
raise Errors::PowerShellNotFound if !available?
if version.to_i < MINIMUM_REQUIRED_VERSION
raise Errors::PowerShellInvalidVersion,
minimum_version: MINIMUM_REQUIRED_VERSION,
installed_version: version ? version : "N/A"
end
@_powershell_validation = true
end
@_powershell_validation
end
# Powerup the given command to perform privileged operations.
#
# @param [String] path
# @param [Array<String>] args
# @return [Array<String>]
def self.powerup_command(path, args, opts)
Dir.mktmpdir("vagrant") do |dpath|
all_args = [path] + args.flatten.map{ |a|
a.gsub(/^['"](.+)['"]$/, "\\1")
}View on GitHub (pinned to 35f3160f4a)
Solutions
- Install Windows Management Framework 5.1 (or at least 4.0) to raise PowerShell above the minimum, then reboot
- Confirm inside PowerShell: $PSVersionTable.PSVersion shows >= 3
- If the host cannot be upgraded, move the Vagrant workload to a modern Windows machine
Example fix
# before: Windows PowerShell 2.0 host PS> $PSVersionTable.PSVersion.ToString() 2.0 # after: install WMF 5.1, reboot, verify PS> $PSVersionTable.PSVersion.ToString() 5.1.19041.1682
Defensive patterns
Strategy: validation
Validate before calling
require 'vagrant/util/powershell' if Vagrant::Util::PowerShell.available? && Vagrant::Util::PowerShell.version.to_i < Vagrant::Util::PowerShell::MINIMUM_REQUIRED_VERSION abort 'PowerShell >= 3 required; install WMF 5.1' end
Try / catch
begin Vagrant::Util::PowerShell.validate_install! rescue Vagrant::Errors::PowerShellInvalidVersion => e warn e.message # shows installed vs minimum raise end
Prevention
- Baseline Windows hosts at PowerShell 5.1 via WMF
- Include $PSVersionTable checks in host provisioning
- Remember Vagrant's floor is major version 3
When it happens
Trigger: Running Windows-side Vagrant features on a host where powershell reports 2.x — legacy Windows without WMF upgrades, or machines deliberately pinned to PS 2.0 for old Exchange-era tooling.
Common situations: Unmodernized legacy Windows Server images; hardened hosts that never received WMF updates.
Related errors
- Failed to locate the powershell executable on the available
- A command must be provided when the --elevated flag is provi
- Your host does not support PowerShell. A remote PowerShell c
- An error occurred while executing a PowerShell script. This
- Installation of the provider '%{provider}' failed! The stdou
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/77139eb704e37203.
Report an issue: GitHub.