{"record":{"id":"77139eb704e37203","repo":"hashicorp/vagrant","slug":"the-version-of-powershell-currently-installed-on-t","errorCode":null,"errorMessage":"The version of powershell currently installed on this host is less than\nthe required minimum version. Please upgrade the installed version of\npowershell to the minimum required version and run the command again.\n\n  Installed version: %{installed_version}\n  Minimum required version: %{minimum_version}","messagePattern":"The version of powershell currently installed on this host is less than\nthe required minimum version\\. Please upgrade the installed version of\npowershell to the minimum required version and run the command again\\.\n\n  Installed version: %(.+?)\n  Minimum required version: %(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::PowerShellInvalidVersion","httpStatus":null,"severity":"error","filePath":"lib/vagrant/util/powershell.rb","lineNumber":248,"sourceCode":"          rescue Vagrant::Util::Subprocess::TimeoutExceeded\n            LOGGER.debug(\"Timeout exceeded while attempting to determine version of Powershell.\")\n          end\n\n          @_powershell_version = version\n        end\n        @_powershell_version\n      end\n\n      # Validates that powershell is installed, available, and\n      # at or above minimum required version\n      #\n      # @return [Boolean]\n      # @raises []\n      def self.validate_install!\n        if !defined?(@_powershell_validation)\n          raise Errors::PowerShellNotFound if !available?\n          if version.to_i < MINIMUM_REQUIRED_VERSION\n            raise Errors::PowerShellInvalidVersion,\n              minimum_version: MINIMUM_REQUIRED_VERSION,\n              installed_version: version ? version : \"N/A\"\n          end\n          @_powershell_validation = true\n        end\n        @_powershell_validation\n      end\n\n      # Powerup the given command to perform privileged operations.\n      #\n      # @param [String] path\n      # @param [Array<String>] args\n      # @return [Array<String>]\n      def self.powerup_command(path, args, opts)\n        Dir.mktmpdir(\"vagrant\") do |dpath|\n          all_args = [path] + args.flatten.map{ |a|\n            a.gsub(/^['\"](.+)['\"]$/, \"\\\\1\")\n          }","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/util/powershell.rb#L230-L266","documentation":"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.","triggerScenarios":"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.","commonSituations":"Unmodernized legacy Windows Server images; hardened hosts that never received WMF updates.","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"],"exampleFix":"# before: Windows PowerShell 2.0 host\nPS> $PSVersionTable.PSVersion.ToString()\n2.0\n\n# after: install WMF 5.1, reboot, verify\nPS> $PSVersionTable.PSVersion.ToString()\n5.1.19041.1682","handlingStrategy":"validation","validationCode":"require 'vagrant/util/powershell'\n\nif Vagrant::Util::PowerShell.available? &&\n   Vagrant::Util::PowerShell.version.to_i < Vagrant::Util::PowerShell::MINIMUM_REQUIRED_VERSION\n  abort 'PowerShell >= 3 required; install WMF 5.1'\nend","typeGuard":null,"tryCatchPattern":"begin\n  Vagrant::Util::PowerShell.validate_install!\nrescue Vagrant::Errors::PowerShellInvalidVersion => e\n  warn e.message # shows installed vs minimum\n  raise\nend","preventionTips":["Baseline Windows hosts at PowerShell 5.1 via WMF","Include $PSVersionTable checks in host provisioning","Remember Vagrant's floor is major version 3"],"tags":["powershell","version","windows","wmf"],"backgroundTag":"minimum-version-not-met","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}