{"id":71,"date":"2019-02-02T11:00:45","date_gmt":"2019-02-02T10:00:45","guid":{"rendered":"https:\/\/jet0jlh.de\/?p=71"},"modified":"2019-02-03T11:00:43","modified_gmt":"2019-02-03T10:00:43","slug":"powershell-09-interaktiv","status":"publish","type":"post","link":"https:\/\/jet0jlh.de\/?p=71","title":{"rendered":"PowerShell #09 &#8211; Interaktiv"},"content":{"rendered":"\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Powershell #09.1 - Interaktive Skripte - Nutzereingabe\" width=\"625\" height=\"352\" src=\"https:\/\/www.youtube.com\/embed\/XRU5BidgIUc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Hier der Code zum kopieren von Tutorial #09.1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"Hallo und herzlich Willkommen.\"\n$name = Read-Host -Prompt \"Wie ist dein Name?\"\necho \"Dein Name ist also $name\"\necho \"Freut mich dich kennenzulernen!\"\necho \"Was ist den deine Lieblingsfarbe?\"\n$farbe = \"Gelb\",\"Gr\u00fcn\",\"Blau\",\"Rot\" | Out-GridView -PassThru -Title \"Lieblingsfarbe\"\nswitch ($farbe) {\n    \"Gelb\" {[console]::ForegroundColor = \"yellow\"}\n    \"Gr\u00fcn\" {[console]::ForegroundColor = \"green\"}\n    \"Blau\" {[console]::ForegroundColor = \"blue\"}\n    \"Rot\" {[console]::ForegroundColor = \"red\"}\n}\n$Host.UI.RawUI.BackgroundColor = \"Black\"\nClear-Host\necho \"$farbe also? Ich stell das dann mal f\u00fcr dich um ;)\"\necho \"Ich hoffe du f\u00fchlst dich nun etwas wohler :)\"\npause<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Powershell #09.2 - Interaktive Skripte - Passworteingabe\" width=\"625\" height=\"352\" src=\"https:\/\/www.youtube.com\/embed\/MEfOWd5p1Ls?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Und hier der ganze Code nach Tutorial #09.2<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function pwEncrypt($password) {\n    return $([System.Runtime.InteropServices.Marshal]::PtrToStringAuto($([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($password))))\n}\n\necho \"Hallo und herzlich Willkommen.\"\n$name = Read-Host -Prompt \"Wie ist dein Name?\"\necho \"Dein Name ist also $name\"\necho \"Freut mich dich kennenzulernen.\"\n$pw = Read-Host -Prompt \"Wie lautet dein Passwort? Keine Angst, es ist bei mir sicher.\" -AsSecureString\necho \"Was ist den deine Lieblingsfarbe?\"\n$farbe = \"Gelb\",\"Gr\u00fcn\",\"Blau\",\"Rot\" | Out-GridView -PassThru -Title \"Lieblingsfarbe\"\nswitch ($farbe) {\n    \"Gelb\" {[console]::ForegroundColor = \"yellow\"}\n    \"Gr\u00fcn\" {[console]::ForegroundColor = \"green\"}\n    \"Blau\" {[console]::ForegroundColor = \"blue\"}\n    \"Rot\" {[console]::ForegroundColor = \"red\"}\n}\n$Host.UI.RawUI.BackgroundColor = \"Black\"\nClear-Host\necho \"$farbe also? Ich stell das dann mal f\u00fcr dich um ;)\"\necho \"Ich hoffe du f\u00fchlst dich nun etwas wohler :)\"\necho \"Sag mal war dein Passwort eigentlich wirklich $(pwEncrypt($pw))\"\npause<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hier der Code zum kopieren von Tutorial #09.1 Und hier der ganze Code nach Tutorial #09.2<\/p>\n","protected":false},"author":1,"featured_media":72,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[3,4],"class_list":["post-71","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-powershell","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/jet0jlh.de\/index.php?rest_route=\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jet0jlh.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jet0jlh.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jet0jlh.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jet0jlh.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=71"}],"version-history":[{"count":5,"href":"https:\/\/jet0jlh.de\/index.php?rest_route=\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":77,"href":"https:\/\/jet0jlh.de\/index.php?rest_route=\/wp\/v2\/posts\/71\/revisions\/77"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jet0jlh.de\/index.php?rest_route=\/wp\/v2\/media\/72"}],"wp:attachment":[{"href":"https:\/\/jet0jlh.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jet0jlh.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jet0jlh.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}