{"record":{"id":"ed14638595515a9b","repo":"puppetlabs/puppet","slug":"could-not-find-command-exe-ed1463","errorCode":null,"errorMessage":"Could not find command '%{exe}'","messagePattern":"Could not find command '%(.+?)'","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/exec/windows.rb","lineNumber":41,"sourceCode":"    **Note on PowerShell scripts:** PowerShell's default `restricted`\n    execution policy doesn't allow it to run saved scripts. To run PowerShell\n    scripts, specify the `remotesigned` execution policy as part of the\n    command:\n\n        exec { 'test':\n          path    => 'C:/Windows/System32/WindowsPowerShell/v1.0',\n          command => 'powershell -executionpolicy remotesigned -file C:/test.ps1',\n        }\n\n  EOT\n\n  # Verify that we have the executable\n  def checkexe(command)\n    exe = extractexe(command)\n\n    if absolute_path?(exe)\n      if !Puppet::FileSystem.exist?(exe)\n        raise ArgumentError, _(\"Could not find command '%{exe}'\") % { exe: exe }\n      elsif !File.file?(exe)\n        raise ArgumentError, _(\"'%{exe}' is a %{klass}, not a file\") % { exe: exe, klass: File.ftype(exe) }\n      end\n\n      return\n    end\n\n    if resource[:path]\n      Puppet::Util.withenv('PATH' => resource[:path].join(File::PATH_SEPARATOR)) do\n        return if which(exe)\n      end\n    end\n\n    raise ArgumentError, _(\"Could not find command '%{exe}'\") % { exe: exe }\n  end\nend\n","sourceCodeStart":23,"sourceCodeEnd":58,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/exec/windows.rb#L23-L58","documentation":"Error \"Could not find command '%{exe}'\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/provider/exec/windows.rb:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}