{"id":2464,"date":"2020-07-27T11:56:36","date_gmt":"2020-07-27T11:56:36","guid":{"rendered":"https:\/\/ricardomoinhos.com\/?p=2464"},"modified":"2020-07-27T14:14:33","modified_gmt":"2020-07-27T14:14:33","slug":"powershell-how-to-install-certificate-automatically-after-creating-the-container","status":"publish","type":"post","link":"https:\/\/ricardomoinhos.com\/pt\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/","title":{"rendered":"Powershell &#8211; How to install the certificate automatically after creating the container"},"content":{"rendered":"\n<p>When a new container is created using navcontainerhelper, if the -useSSL flag is used, a self-signed certificate is created and the url to the certificate file is retrieved.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"625\" height=\"363\" src=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2020\/07\/image.png\" alt=\"\" class=\"wp-image-2465\" srcset=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2020\/07\/image.png 625w, https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2020\/07\/image-300x174.png 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/figure>\n\n\n\n<p><p>How to download and install the self-signed certificate after creating the container, using Powershell commands?<\/p>\n<p>Like this:<\/p><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$containername = 'bccontainer'\n\u2029$outputCertFilePath = 'C:\\Temp\\' + $containername + '_Certificate.cer'\u2029\u2029\n\n# Download the certificate from container\n\u2029$url = 'http:\/\/' + $containername + ':8080\/certificate.cer'\u2029\nInvoke-WebRequest -Uri $url -OutFile $outputCertFilePath\n\u2029\u2029# Import downloaded certificate to trusted root\n\u2029Import-Certificate -FilePath $outputCertFilePath -CertStoreLocation 'Cert:\\LocalMachine\\Root' -Verbose<\/pre>\n\n\n\n<p>Now the browser can be closed, if opened, and opened again. The certificate is installed and the browser won&#8217;t complain about it.<\/p>\n\n\n\n<p>Please feel free to leave your comments.<\/p>\n\n\n<p>#businesscentral #navcontainerhelper #powershell #certificate<\/p>","protected":false},"excerpt":{"rendered":"<p>When a new container is created using navcontainerhelper, if the -useSSL flag is used, a self-signed certificate is created and the url to the certificate file is retrieved. How to download and install the self-signed certificate after creating the container, using Powershell commands? Like this: $containername = &#8216;bccontainer&#8217; \u2029$outputCertFilePath = &#8216;C:\\Temp\\&#8217; + $containername + &#8216;_Certificate.cer&#8217;\u2029\u2029 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1358,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[4],"tags":[59,6,66,65],"class_list":{"0":"post-2464","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-dynamics365bc","8":"tag-businesscentral","9":"tag-dynamicsnav-2","10":"tag-navcontainerhelper","11":"tag-powershell","13":"post-with-thumbnail","14":"post-with-thumbnail-icon"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Powershell - How to install the certificate automatically after creating the container - Ricardo Paiva Moinhos<\/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:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/\" \/>\n<meta property=\"og:locale\" content=\"pt_PT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Powershell - How to install the certificate automatically after creating the container - Ricardo Paiva Moinhos\" \/>\n<meta property=\"og:description\" content=\"When a new container is created using navcontainerhelper, if the -useSSL flag is used, a self-signed certificate is created and the url to the certificate file is retrieved. How to download and install the self-signed certificate after creating the container, using Powershell commands? Like this: $containername = &#039;bccontainer&#039; \u2029$outputCertFilePath = &#039;C:Temp&#039; + $containername + &#039;_Certificate.cer&#039;\u2029\u2029 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/\" \/>\n<meta property=\"og:site_name\" content=\"Ricardo Paiva Moinhos\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-27T11:56:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-07-27T14:14:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2020\/02\/Microsoft-Dynamics-365-Business-Central-Logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"256\" \/>\n\t<meta property=\"og:image:height\" content=\"256\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ricardo Paiva Moinhos\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ricardo Paiva Moinhos\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo estimado de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/\"},\"author\":{\"name\":\"Ricardo Paiva Moinhos\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/#\\\/schema\\\/person\\\/16dcfdd54ec1c46bd1941659739de4cc\"},\"headline\":\"Powershell &#8211; How to install the certificate automatically after creating the container\",\"datePublished\":\"2020-07-27T11:56:36+00:00\",\"dateModified\":\"2020-07-27T14:14:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/\"},\"wordCount\":90,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ricardomoinhos.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/Microsoft-Dynamics-365-Business-Central-Logo.png\",\"keywords\":[\"\",\"dynamicsnav\",\"navcontainerhelper\",\"powershell\"],\"articleSection\":[\"Dynamics NAV\\\/365 BC\"],\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/\",\"url\":\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/\",\"name\":\"Powershell - How to install the certificate automatically after creating the container - Ricardo Paiva Moinhos\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ricardomoinhos.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/Microsoft-Dynamics-365-Business-Central-Logo.png\",\"datePublished\":\"2020-07-27T11:56:36+00:00\",\"dateModified\":\"2020-07-27T14:14:33+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/#\\\/schema\\\/person\\\/16dcfdd54ec1c46bd1941659739de4cc\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/#breadcrumb\"},\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/#primaryimage\",\"url\":\"https:\\\/\\\/ricardomoinhos.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/Microsoft-Dynamics-365-Business-Central-Logo.png\",\"contentUrl\":\"https:\\\/\\\/ricardomoinhos.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/Microsoft-Dynamics-365-Business-Central-Logo.png\",\"width\":256,\"height\":256},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/powershell-how-to-install-certificate-automatically-after-creating-the-container\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ricardomoinhos.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Powershell &#8211; How to install the certificate automatically after creating the container\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/#website\",\"url\":\"https:\\\/\\\/ricardomoinhos.com\\\/\",\"name\":\"Ricardo Paiva Moinhos\",\"description\":\"Welcome\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ricardomoinhos.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-PT\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ricardomoinhos.com\\\/#\\\/schema\\\/person\\\/16dcfdd54ec1c46bd1941659739de4cc\",\"name\":\"Ricardo Paiva Moinhos\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/248366f4e615e182964f85f799c6e33cbd541a6f4ca7ee948fc16d1c14030c76?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/248366f4e615e182964f85f799c6e33cbd541a6f4ca7ee948fc16d1c14030c76?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/248366f4e615e182964f85f799c6e33cbd541a6f4ca7ee948fc16d1c14030c76?s=96&d=mm&r=g\",\"caption\":\"Ricardo Paiva Moinhos\"},\"url\":\"https:\\\/\\\/ricardomoinhos.com\\\/pt\\\/author\\\/ricardopaiva\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Powershell - How to install the certificate automatically after creating the container - Ricardo Paiva Moinhos","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:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/","og_locale":"pt_PT","og_type":"article","og_title":"Powershell - How to install the certificate automatically after creating the container - Ricardo Paiva Moinhos","og_description":"When a new container is created using navcontainerhelper, if the -useSSL flag is used, a self-signed certificate is created and the url to the certificate file is retrieved. How to download and install the self-signed certificate after creating the container, using Powershell commands? Like this: $containername = 'bccontainer' \u2029$outputCertFilePath = 'C:Temp' + $containername + '_Certificate.cer'\u2029\u2029 [&hellip;]","og_url":"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/","og_site_name":"Ricardo Paiva Moinhos","article_published_time":"2020-07-27T11:56:36+00:00","article_modified_time":"2020-07-27T14:14:33+00:00","og_image":[{"width":256,"height":256,"url":"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2020\/02\/Microsoft-Dynamics-365-Business-Central-Logo.png","type":"image\/png"}],"author":"Ricardo Paiva Moinhos","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Ricardo Paiva Moinhos","Tempo estimado de leitura":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/#article","isPartOf":{"@id":"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/"},"author":{"name":"Ricardo Paiva Moinhos","@id":"https:\/\/ricardomoinhos.com\/#\/schema\/person\/16dcfdd54ec1c46bd1941659739de4cc"},"headline":"Powershell &#8211; How to install the certificate automatically after creating the container","datePublished":"2020-07-27T11:56:36+00:00","dateModified":"2020-07-27T14:14:33+00:00","mainEntityOfPage":{"@id":"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/"},"wordCount":90,"commentCount":0,"image":{"@id":"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/#primaryimage"},"thumbnailUrl":"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2020\/02\/Microsoft-Dynamics-365-Business-Central-Logo.png","keywords":["","dynamicsnav","navcontainerhelper","powershell"],"articleSection":["Dynamics NAV\/365 BC"],"inLanguage":"pt-PT","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/","url":"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/","name":"Powershell - How to install the certificate automatically after creating the container - Ricardo Paiva Moinhos","isPartOf":{"@id":"https:\/\/ricardomoinhos.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/#primaryimage"},"image":{"@id":"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/#primaryimage"},"thumbnailUrl":"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2020\/02\/Microsoft-Dynamics-365-Business-Central-Logo.png","datePublished":"2020-07-27T11:56:36+00:00","dateModified":"2020-07-27T14:14:33+00:00","author":{"@id":"https:\/\/ricardomoinhos.com\/#\/schema\/person\/16dcfdd54ec1c46bd1941659739de4cc"},"breadcrumb":{"@id":"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/#breadcrumb"},"inLanguage":"pt-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/"]}]},{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/#primaryimage","url":"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2020\/02\/Microsoft-Dynamics-365-Business-Central-Logo.png","contentUrl":"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2020\/02\/Microsoft-Dynamics-365-Business-Central-Logo.png","width":256,"height":256},{"@type":"BreadcrumbList","@id":"https:\/\/ricardomoinhos.com\/powershell-how-to-install-certificate-automatically-after-creating-the-container\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ricardomoinhos.com\/"},{"@type":"ListItem","position":2,"name":"Powershell &#8211; How to install the certificate automatically after creating the container"}]},{"@type":"WebSite","@id":"https:\/\/ricardomoinhos.com\/#website","url":"https:\/\/ricardomoinhos.com\/","name":"Ricardo Paiva Moinhos","description":"Welcome","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ricardomoinhos.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-PT"},{"@type":"Person","@id":"https:\/\/ricardomoinhos.com\/#\/schema\/person\/16dcfdd54ec1c46bd1941659739de4cc","name":"Ricardo Paiva Moinhos","image":{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/secure.gravatar.com\/avatar\/248366f4e615e182964f85f799c6e33cbd541a6f4ca7ee948fc16d1c14030c76?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/248366f4e615e182964f85f799c6e33cbd541a6f4ca7ee948fc16d1c14030c76?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/248366f4e615e182964f85f799c6e33cbd541a6f4ca7ee948fc16d1c14030c76?s=96&d=mm&r=g","caption":"Ricardo Paiva Moinhos"},"url":"https:\/\/ricardomoinhos.com\/pt\/author\/ricardopaiva\/"}]}},"jetpack_featured_media_url":"https:\/\/ricardomoinhos.com\/wp-content\/uploads\/2020\/02\/Microsoft-Dynamics-365-Business-Central-Logo.png","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/posts\/2464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/comments?post=2464"}],"version-history":[{"count":14,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/posts\/2464\/revisions"}],"predecessor-version":[{"id":2495,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/posts\/2464\/revisions\/2495"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/media\/1358"}],"wp:attachment":[{"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/media?parent=2464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/categories?post=2464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ricardomoinhos.com\/pt\/wp-json\/wp\/v2\/tags?post=2464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}