{"id":33,"date":"2017-06-18T12:55:33","date_gmt":"2017-06-18T16:55:33","guid":{"rendered":"http:\/\/ziviz.us\/WP\/?p=33"},"modified":"2017-06-18T13:01:47","modified_gmt":"2017-06-18T17:01:47","slug":"powershell-signing","status":"publish","type":"post","link":"https:\/\/www.ziviz.net\/WP\/2017\/06\/18\/powershell-signing\/","title":{"rendered":"PowerShell Signing"},"content":{"rendered":"<p style=\"text-align: center;\"><em>This post was migrated from my older blog.<\/em><\/p>\n<p>I wanted to sign a PowerShell script to make it easier and more secure to use in our environment. PowerShell signing was not in great use in the environment. To make signing the scripts easier I created a <a href=\"https:\/\/github.com\/zincarla\/SignFile.ps1\">simple script<\/a> to help with the signing process. There was an issue however. We have generic, fully trusted, all purposes certificates. Despite being fully trusted and all purpose, they did not show up as valid certificates in PowerShell. I tried manually running:<\/p>\n<pre><code class=\"powershell\">Get-ChildItem cert:\\CurrentUser\\My -codesigning<\/code><\/pre>\n<p>It returned nothing. The certificates should work, but they weren&#8217;t showing up. I checked the certificate inside of the Certificate Store. Inside the certificate&#8217;s properties on the &#8220;General&#8221; tab, there is a &#8220;Certificate purposes&#8221; group box. Inside of this &#8220;Enable all purposes for this certificate&#8221; was selected.<\/p>\n<figure id=\"attachment_34\" aria-describedby=\"caption-attachment-34\" style=\"width: 241px\" class=\"wp-caption alignright\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-34\" src=\"http:\/\/ziviz.us\/WP\/wp-content\/uploads\/2017\/06\/CertStore-241x300.png\" alt=\"CertStore\" width=\"241\" height=\"300\" srcset=\"https:\/\/www.ziviz.net\/WP\/wp-content\/uploads\/2017\/06\/CertStore-241x300.png 241w, https:\/\/www.ziviz.net\/WP\/wp-content\/uploads\/2017\/06\/CertStore.png 421w\" sizes=\"auto, (max-width: 241px) 85vw, 241px\" \/><figcaption id=\"caption-attachment-34\" class=\"wp-caption-text\">Showing how to manually enable all purposes<\/figcaption><\/figure>\n<p>Since that was not working, I selected &#8220;Enable only for the following purposes&#8221;.<br \/>\nBy default, all purposes were already checked. I clicked &#8220;Ok&#8221; and ran the Get-ChildItem command again and the certificate was finally listed. I ran through the signing process successfully. The signature on the PowerShell file was trusted and valid.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post was migrated from my older blog. I wanted to sign a PowerShell script to make it easier and more secure to use in our environment. PowerShell signing was not in great use in the environment. To make signing the scripts easier I created a simple script to help with the signing process. There &hellip; <a href=\"https:\/\/www.ziviz.net\/WP\/2017\/06\/18\/powershell-signing\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;PowerShell Signing&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-code-release","category-powershell"],"_links":{"self":[{"href":"https:\/\/www.ziviz.net\/WP\/wp-json\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ziviz.net\/WP\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ziviz.net\/WP\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ziviz.net\/WP\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ziviz.net\/WP\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":4,"href":"https:\/\/www.ziviz.net\/WP\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":183,"href":"https:\/\/www.ziviz.net\/WP\/wp-json\/wp\/v2\/posts\/33\/revisions\/183"}],"wp:attachment":[{"href":"https:\/\/www.ziviz.net\/WP\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ziviz.net\/WP\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ziviz.net\/WP\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}