{"id":2149,"date":"2025-04-16T06:55:28","date_gmt":"2025-04-16T06:55:28","guid":{"rendered":"https:\/\/www.devopsconsulting.in\/blog\/?p=2149"},"modified":"2025-04-16T06:55:31","modified_gmt":"2025-04-16T06:55:31","slug":"why-eval-doesnt-work-in-powershell-and-how-to-fix-it","status":"publish","type":"post","link":"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/","title":{"rendered":"How to Fix &#8220;unable to start ssh-agent service, error: 1058&#8221; and &#8220;&#8216;eval&#8217; is not recognized&#8221; on Windows"},"content":{"rendered":"\n<p><strong>How to Fix &#8220;unable to start ssh-agent service, error: 1058&#8221; and &#8220;&#8216;eval&#8217; is not recognized&#8221; on Windows<\/strong><\/p>\n\n\n\n<p>When working with SSH keys on Windows, you may encounter two common errors:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>&#8220;unable to start ssh-agent service, error: 1058&#8221;<\/strong><\/li>\n\n\n\n<li><strong>&#8220;&#8216;eval&#8217; is not recognized as the name of a cmdlet, function, script file, or operable program&#8221;<\/strong><\/li>\n<\/ul>\n\n\n\n<p>This article explains why these errors occur and provides a clear, step-by-step solution to get your SSH keys working on Windows.<\/p>\n\n\n\n<p><strong>What Causes These Errors?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Error 1058<\/strong>: This means the SSH agent service (<code>OpenSSH Authentication Agent<\/code>) is installed but disabled or not running on your system.<\/li>\n\n\n\n<li><strong>&#8216;eval&#8217; is not recognized<\/strong>: The <code>eval<\/code> command is a Unix\/Linux shell command, not available in Windows PowerShell or Command Prompt.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Solution: Step-by-Step Guide<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. Enable and Start the SSH Agent Service<\/strong><\/h2>\n\n\n\n<p>The SSH agent must be running to manage your SSH keys. Here\u2019s how to enable it:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Press <strong>Windows + R<\/strong>, type <code>services.msc<\/code>, and press <strong>Enter<\/strong>.<\/li>\n\n\n\n<li>Scroll to <strong>OpenSSH Authentication Agent<\/strong>.<\/li>\n\n\n\n<li>Right-click and select <strong>Properties<\/strong>.<\/li>\n\n\n\n<li>Set <strong>Startup type<\/strong> to <strong>Manual<\/strong> or <strong>Automatic<\/strong> (Manual is often recommended for security)<\/li>\n\n\n\n<li>Click <strong>Start<\/strong> to run the service.<\/li>\n\n\n\n<li>Click <strong>OK<\/strong> to save and close.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"612\" src=\"https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-12-1024x612.png\" alt=\"\" class=\"wp-image-2150\" srcset=\"https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-12-1024x612.png 1024w, https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-12-300x179.png 300w, https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-12-768x459.png 768w, https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-12.png 1250w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Alternatively, you can do this via PowerShell (as Administrator):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">powershell<code>Get-Service ssh-agent | Set-Service -StartupType Manual\nStart-Service ssh-agent\n<\/code><\/pre>\n\n\n\n<p>This ensures the agent is enabled and running<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. Add Your SSH Keys Using PowerShell<\/strong><\/h2>\n\n\n\n<p>With the agent running, add your SSH keys:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">powershell<code>ssh-add C:\\Users\\YourUsername\\.ssh\\id_rsa\n<\/code><\/pre>\n\n\n\n<p>Replace <code>id_rsa<\/code> with your actual key file name if different.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3. Verify Loaded SSH Keys<\/strong><\/h2>\n\n\n\n<p>Check that your keys are loaded:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">powershell<code>ssh-add -l\n<\/code><\/pre>\n\n\n\n<p>This lists the fingerprints of all loaded keys.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>4. Why &#8216;eval&#8217; Doesn&#8217;t Work on Windows<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>eval \"$(ssh-agent -s)\"<\/code> command is for Unix shells like Bash, not PowerShell or Command Prompt<a href=\"https:\/\/stackoverflow.com\/questions\/69245904\/eval-is-not-recognised-on-windows\" target=\"_blank\" rel=\"noreferrer noopener\">2<\/a><a href=\"https:\/\/bobbyhadz.com\/blog\/eval-is-not-recognized-as-internal-or-external-command\" target=\"_blank\" rel=\"noreferrer noopener\">6<\/a>.<\/li>\n\n\n\n<li>On Windows, you do <strong>not<\/strong> need <code>eval<\/code>. Just ensure the agent service is running and use <code>ssh-add<\/code> as shown above.<\/li>\n<\/ul>\n\n\n\n<p>If you need to evaluate a string as a command in PowerShell, use <code>Invoke-Expression<\/code>, but for SSH agent management, this is unnecessary<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Summary Table<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Task<\/th><th>Action<\/th><\/tr><\/thead><tbody><tr><td>Enable SSH Agent<\/td><td>Set &#8220;OpenSSH Authentication Agent&#8221; to Manual\/Automatic and Start it<\/td><\/tr><tr><td>Add SSH key (personal)<\/td><td><code>ssh-add C:\\Users\\YourUsername\\.ssh\\id_rsa_personal<\/code><\/td><\/tr><tr><td>Add SSH key (work)<\/td><td><code>ssh-add C:\\Users\\YourUsername\\.ssh\\id_rsa_work<\/code><\/td><\/tr><tr><td>List loaded keys<\/td><td><code>ssh-add -l<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Key Takeaways<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Do not use <code>eval<\/code> on Windows<\/strong>; it\u2019s a Unix command not available in PowerShell or CMD.<\/li>\n\n\n\n<li><strong>Enable and start the OpenSSH Authentication Agent<\/strong> via Services or PowerShell.<\/li>\n\n\n\n<li><strong>Use <code>ssh-add<\/code> to manage your SSH keys<\/strong> once the agent is running.<\/li>\n<\/ul>\n\n\n\n<p>By following these steps, you will resolve both the &#8220;unable to start ssh-agent service, error: 1058&#8221; and &#8220;&#8216;eval&#8217; is not recognized&#8221; errors, enabling smooth SSH key management on Windows.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Fix &#8220;unable to start ssh-agent service, error: 1058&#8221; and &#8220;&#8216;eval&#8217; is not recognized&#8221; on Windows When working with [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2151,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[164],"tags":[1338,1342,1335,1341,1336,1337,1339],"class_list":["post-2149","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-github","tag-eval-error-on-windows-causes-and-solutions","tag-eval-command-misuse-in-windows-environments-a-guide","tag-fixing-eval-not-recognized-error-in-powershell","tag-getting-rid-of-the-eval-error-in-your-windows-terminal","tag-resolving-eval-command-issue-on-windows","tag-troubleshooting-the-eval-command-in-windows-ssh","tag-why-eval-doesnt-work-in-powershell-and-how-to-fix-it"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Fix &quot;unable to start ssh-agent service, error: 1058&quot; and &quot;&#039;eval&#039; is not recognized&quot; on Windows - DevOps Consulting<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Fix &quot;unable to start ssh-agent service, error: 1058&quot; and &quot;&#039;eval&#039; is not recognized&quot; on Windows - DevOps Consulting\" \/>\n<meta property=\"og:description\" content=\"How to Fix &#8220;unable to start ssh-agent service, error: 1058&#8221; and &#8220;&#8216;eval&#8217; is not recognized&#8221; on Windows When working with [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps Consulting\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-16T06:55:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-16T06:55:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-13.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1331\" \/>\n\t<meta property=\"og:image:height\" content=\"882\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Abhishek Singh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abhishek Singh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/\",\"url\":\"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/\",\"name\":\"How to Fix \\\"unable to start ssh-agent service, error: 1058\\\" and \\\"'eval' is not recognized\\\" on Windows - DevOps Consulting\",\"isPartOf\":{\"@id\":\"https:\/\/www.devopsconsulting.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-13.png\",\"datePublished\":\"2025-04-16T06:55:28+00:00\",\"dateModified\":\"2025-04-16T06:55:31+00:00\",\"author\":{\"@id\":\"https:\/\/www.devopsconsulting.in\/blog\/#\/schema\/person\/fc397ba8be42f9fdd53450edfc73006f\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/#primaryimage\",\"url\":\"https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-13.png\",\"contentUrl\":\"https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-13.png\",\"width\":1331,\"height\":882},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.devopsconsulting.in\/blog\/#website\",\"url\":\"https:\/\/www.devopsconsulting.in\/blog\/\",\"name\":\"DevOps Consulting\",\"description\":\"DevOps Consulting | SRE Consulting | DevSecOps Consulting | MLOps Consulting\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.devopsconsulting.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.devopsconsulting.in\/blog\/#\/schema\/person\/fc397ba8be42f9fdd53450edfc73006f\",\"name\":\"Abhishek Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.devopsconsulting.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g\",\"caption\":\"Abhishek Singh\"},\"description\":\"I\u2019m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I\u2019ve had the opportunity to work with Cotocus and continue to contribute to multiple platforms where I share insights across different domains: \u2022 DevOps School \u2013 Tech blogs and tutorials \u2022 Holiday Landmark \u2013 Travel stories and guides \u2022 Stocks Mantra \u2013 Stock market strategies and tips \u2022 My Medic Plus \u2013 Health and fitness guidance \u2022 TrueReviewNow \u2013 Honest product reviews \u2022 Wizbrand \u2013 SEO and digital tools for businesses I\u2019m also exploring the fascinating world of Quantum Computing.\",\"url\":\"https:\/\/www.devopsconsulting.in\/blog\/author\/abhishek\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Fix \"unable to start ssh-agent service, error: 1058\" and \"'eval' is not recognized\" on Windows - DevOps Consulting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/","og_locale":"en_US","og_type":"article","og_title":"How to Fix \"unable to start ssh-agent service, error: 1058\" and \"'eval' is not recognized\" on Windows - DevOps Consulting","og_description":"How to Fix &#8220;unable to start ssh-agent service, error: 1058&#8221; and &#8220;&#8216;eval&#8217; is not recognized&#8221; on Windows When working with [&hellip;]","og_url":"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/","og_site_name":"DevOps Consulting","article_published_time":"2025-04-16T06:55:28+00:00","article_modified_time":"2025-04-16T06:55:31+00:00","og_image":[{"width":1331,"height":882,"url":"https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-13.png","type":"image\/png"}],"author":"Abhishek Singh","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Abhishek Singh","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/","url":"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/","name":"How to Fix \"unable to start ssh-agent service, error: 1058\" and \"'eval' is not recognized\" on Windows - DevOps Consulting","isPartOf":{"@id":"https:\/\/www.devopsconsulting.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/#primaryimage"},"image":{"@id":"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/#primaryimage"},"thumbnailUrl":"https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-13.png","datePublished":"2025-04-16T06:55:28+00:00","dateModified":"2025-04-16T06:55:31+00:00","author":{"@id":"https:\/\/www.devopsconsulting.in\/blog\/#\/schema\/person\/fc397ba8be42f9fdd53450edfc73006f"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopsconsulting.in\/blog\/why-eval-doesnt-work-in-powershell-and-how-to-fix-it\/#primaryimage","url":"https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-13.png","contentUrl":"https:\/\/www.devopsconsulting.in\/blog\/wp-content\/uploads\/2025\/04\/image-13.png","width":1331,"height":882},{"@type":"WebSite","@id":"https:\/\/www.devopsconsulting.in\/blog\/#website","url":"https:\/\/www.devopsconsulting.in\/blog\/","name":"DevOps Consulting","description":"DevOps Consulting | SRE Consulting | DevSecOps Consulting | MLOps Consulting","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.devopsconsulting.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.devopsconsulting.in\/blog\/#\/schema\/person\/fc397ba8be42f9fdd53450edfc73006f","name":"Abhishek Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopsconsulting.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g","caption":"Abhishek Singh"},"description":"I\u2019m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I\u2019ve had the opportunity to work with Cotocus and continue to contribute to multiple platforms where I share insights across different domains: \u2022 DevOps School \u2013 Tech blogs and tutorials \u2022 Holiday Landmark \u2013 Travel stories and guides \u2022 Stocks Mantra \u2013 Stock market strategies and tips \u2022 My Medic Plus \u2013 Health and fitness guidance \u2022 TrueReviewNow \u2013 Honest product reviews \u2022 Wizbrand \u2013 SEO and digital tools for businesses I\u2019m also exploring the fascinating world of Quantum Computing.","url":"https:\/\/www.devopsconsulting.in\/blog\/author\/abhishek\/"}]}},"_links":{"self":[{"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/posts\/2149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/comments?post=2149"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/posts\/2149\/revisions"}],"predecessor-version":[{"id":2152,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/posts\/2149\/revisions\/2152"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/media\/2151"}],"wp:attachment":[{"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/media?parent=2149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/categories?post=2149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/tags?post=2149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}