{"id":188,"date":"2018-04-26T19:24:39","date_gmt":"2018-04-26T16:24:39","guid":{"rendered":"http:\/\/talhacelik.com.tr\/?p=188"},"modified":"2020-04-29T20:59:18","modified_gmt":"2020-04-29T17:59:18","slug":"windows-powershell-scripting","status":"publish","type":"post","link":"https:\/\/talhacelik.com.tr\/index.php\/2018\/04\/26\/windows-powershell-scripting\/","title":{"rendered":"Windows PowerShell Scripting"},"content":{"rendered":"<p><span style=\"font-size: 14pt; font-family: arial, helvetica, sans-serif;\"><strong>PowerShell Nedir ?<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: arial, helvetica, sans-serif;\">PowerShell, Windows i\u015fletim sisteminin Windows7 ile geli\u015ftirip piyasaya s\u00fcrd\u00fc\u011f\u00fc, Unix tabanl\u0131 i\u015fletimi sistemlerinde bash yap\u0131s\u0131na benzer, <strong>Cmdlet<\/strong>* ler ile y\u00f6netilen .Net yaz\u0131l\u0131m\u0131n\u0131 destekleyen bir programlama dilidir. PowerShell sistem i\u00e7erisinde pratik i\u015flemleri yapmay\u0131 sa\u011flayan, genelde sistem y\u00f6neticileri taraf\u0131ndan olduk\u00e7a ra\u011fbet g\u00f6ren bir <strong>programlama dilidir.<\/strong><\/span><\/p>\n<blockquote><p><span style=\"font-family: arial, helvetica, sans-serif;\"><em><span style=\"font-size: 10pt;\">[*]PowerShell&#8217;in sahip oldu\u011fu komulara verilen isim.<\/span><\/em><\/span><\/p><\/blockquote>\n<p><span style=\"font-size: 14pt; font-family: arial, helvetica, sans-serif;\"><strong>PowerShell Kullan\u0131m\u0131<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: arial, helvetica, sans-serif;\">Windows ortam\u0131nda<strong>\u00a0Win + R<\/strong> kombinasyonu ile <strong>Run <\/strong>arac\u0131n\u0131 a\u00e7\u0131p <strong>powershell <\/strong>yazd\u0131ktan sonra PowerShell aray\u00fcz\u00fcn\u00fc a\u00e7\u0131yoruz.<\/span><\/p>\n<figure id=\"attachment_198\" aria-describedby=\"caption-attachment-198\" style=\"width: 621px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-198\" src=\"http:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/1-300x56.png\" alt=\"\" width=\"621\" height=\"116\" srcset=\"https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/1-300x56.png 300w, https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/1-768x143.png 768w, https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/1-780x146.png 780w, https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/1.png 863w\" sizes=\"(max-width: 621px) 100vw, 621px\" \/><figcaption id=\"caption-attachment-198\" class=\"wp-caption-text\"><span style=\"font-family: arial, helvetica, sans-serif;\">PowerShell Aray\u00fcz\u00fc<\/span><\/figcaption><\/figure>\n<p><span style=\"font-family: arial, helvetica, sans-serif;\">Bu i\u015flemi yapt\u0131ktan sonra Cmdlet&#8217;leri tan\u0131y\u0131p uygulayal\u0131m.<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\">#Hello PowerShell\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #Yorum Sat\u0131r\u0131<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> help [Parametre]\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0#Parametre olarak verilen komutun k\u0131sa d\u00f6k\u00fcman\u0131<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\"> cd [Destination Folder]\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #Hedef dizine gider<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> cd ..\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0#Bulunulan dizinden bir alt dizine gider<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> ls [Parametre]\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0#Bulunulan dizinin i\u00e7eri\u011fini verir<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\">rmdir [Paramretre]\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0#RemoveDirectory &#8211; Dizin silme<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> mkdir [Paramretre]\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #MakeDirectory &#8211; Dizin yaratma<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\">Write-Host [Paramretre]\u00a0 \u00a0 \u00a0 \u00a0#Ekrana \u00e7\u0131kt\u0131 g\u00f6nderme<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> echo [Paramretre]\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #Ekrana \u00e7\u0131kt\u0131 g\u00f6nderme<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\">Read-Host\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0#Veri alma<\/span><\/p>\n<p><span style=\"font-size: 14pt; font-family: arial, helvetica, sans-serif;\"><strong>De\u011fi\u015fkenler ve Diziler<\/strong><\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\"> [int] $value = 2<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> $value.GetType()<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif;\"> IsPublic\u00a0\u00a0\u00a0 IsSerial\u00a0 \u00a0 \u00a0 Name\u00a0\u00a0\u00a0\u00a0\u00a0 BaseType<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> &#8212;&#8212;&#8211;\u00a0 \u00a0 \u00a0 \u00a0&#8212;&#8212;&#8211;\u00a0 \u00a0 \u00a0 \u00a0 &#8212;-\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#8212;&#8212;&#8211;<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> True\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 True\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Int32\u00a0 \u00a0 \u00a0 \u00a0 System.ValueType<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif;\"> Yukar\u0131daki komutta ilk olarak integer tipinde bir de\u011fi\u015fken olu\u015fturduk ve ard\u0131nda haf\u0131zaya y\u00fckledik.<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> Y\u00fcklenene $value de\u011fi\u015fkeninin GetType() fonksiyonu yard\u0131m\u0131 ile genel yap\u0131s\u0131 hakk\u0131nda bilgi sahibi olduk.<\/span><\/p>\n<p><span style=\"font-size: 14pt; font-family: arial, helvetica, sans-serif;\"> <strong>Hata S\u0131n\u0131flar\u0131 (Exceptions)<\/strong><\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif;\"> E\u011fer yukar\u0131daki komutta tipi \u00f6nceden belirlenmi\u015f olan de\u011fi\u015fkene farkl\u0131 bir tipte de\u011fer atamaya \u00e7al\u0131\u015f\u0131rsak<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> <strong>ArgumentTransformationMetadataException <\/strong>hatas\u0131n\u0131 al\u0131r\u0131z.<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif;\"> <em>Tabii PowerShell ile yazarken de\u011fi\u015fken tipi belirtmek zorunda de\u011filiz.<\/em><\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif;\"> <span style=\"font-size: 14pt;\"><strong>\u00d6rnek Uygulama<\/strong><strong><br \/>\n<\/strong><\/span><\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\">_&gt; $question= Read-Host &#8220;PowerShell Nedir ?&#8221;<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> &gt;&gt; PowerShell Nedir ? : Bir Programlama Dilidir.<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; Write-Host $question<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> &gt;&gt; Bir Programlama Dilidir.<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; $my_array = (&#8220;PowerShell&#8221;,&#8221;Windows&#8221;,&#8221;Scripting&#8221;)<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; Write-Host $my_array<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> &gt;&gt; PowerShell Windows Scripting<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; Write-Host $my_array[0]<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> &gt;&gt; PowerShell<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; Write-Host $my_array.Lenght<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> &gt;&gt; 3<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; $my_array.GetType()<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\"> IsPublic\u00a0\u00a0\u00a0 IsSerial\u00a0\u00a0\u00a0 Name\u00a0\u00a0\u00a0\u00a0 \u00a0BaseType<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> &#8212;&#8212;&#8211;\u00a0 \u00a0 \u00a0 \u00a0&#8212;&#8212;&#8211;\u00a0 \u00a0 \u00a0 \u00a0&#8212;-\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#8212;&#8212;&#8211;<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> True\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 True\u00a0 \u00a0 \u00a0 \u00a0 \u00a0Object[]\u00a0 \u00a0 System.Array<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; $files = Get-ChildItem<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; Write-Host $files<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; #Bulundu\u011funuz dizin i\u00e7indeki dosyalar\u0131n isimlerini $files de\u011fi\u015fkenine atar.<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif;\"> <strong><span style=\"font-size: 14pt;\">De\u011fi\u015fkeni S\u0131f\u0131rlamak<\/span><\/strong><\/span><\/p>\n<p>Ya\u015fam d\u00f6ng\u00fcs\u00fc biten ve art\u0131k kullan\u0131lmayacak olan de\u011fi\u015fkenlerin i\u00e7erisini<br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> bo\u015faltmak i\u00e7in sistem ile gelen <strong>$null<\/strong> de\u011fi\u015fkenini kullan\u0131yoruz.<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; $my_array = $null<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; echo $my_array<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> &gt;&gt; <\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; #Bize bo\u015f bir \u00e7\u0131kt\u0131 verecektir.<\/span><\/p>\n<p><span style=\"font-size: 14pt; font-family: arial, helvetica, sans-serif;\"> <strong>Dosya Okuma ve Yazma \u0130\u015flemleri<\/strong><strong><br \/>\n<\/strong><\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif;\"> Terminal \u00fczerinde pratik ve h\u0131zl\u0131 bir \u015fekilde dosyalar aras\u0131nda gezinmek kadar onlar\u0131 ta\u015f\u0131mak,<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> kopyalamak,silmek, okumak ve yazmakta olduk\u00e7a \u00f6nemlidir.<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; echo &#8220;New file in to &#8230;&#8221; &gt; new_file.txt<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; Get_Content new_file.txt<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> &gt;&gt; New file in to &#8230;<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif;\"> _&gt; #Al\u0131nan bu \u00e7\u0131kt\u0131 sayesinde dosyay\u0131 ba\u015far\u0131l\u0131 bir \u015fekilde yaz\u0131p okudu\u011fumuz anlam\u0131na geliyor<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: arial, helvetica, sans-serif;\"> Burada echo komutuna alternatif olarak <strong>Out-File<\/strong> komutunuda kullanabiliriz. Fakat\u00a0Out-File komutu sadece dosya yaratmam\u0131z\u0131 sa\u011flayacakt\u0131r. \u0130\u00e7erisine yazmak i\u00e7in\u00a0yine echo kullanaca\u011f\u0131z.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: arial, helvetica, sans-serif;\">E\u011fer &gt; (b\u00fcy\u00fckt\u00fcr) i\u015faretini bir adet kullan\u0131rsak dosyan\u0131n i\u00e7inde ne varsa silip\u00a0yeni de\u011feri ekler. Dosyan\u0131n sonuna ekleme yapmak i\u00e7in &gt;&gt; i\u015faretini kullanmam\u0131z\u00a0yeterli olacakt\u0131r.<\/span><\/p>\n<p><span style=\"font-size: 14pt; font-family: arial, helvetica, sans-serif;\"><strong>Scripting<\/strong><\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-191 aligncenter\" src=\"http:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/ps3-300x169.jpg\" alt=\"\" width=\"695\" height=\"392\" srcset=\"https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/ps3-300x169.jpg 300w, https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/ps3-768x432.jpg 768w, https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/ps3-1024x576.jpg 1024w, https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/ps3-1600x900.jpg 1600w, https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/ps3-780x439.jpg 780w, https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/ps3.jpg 1920w\" sizes=\"(max-width: 695px) 100vw, 695px\" \/><\/p>\n<p>PowerShell&#8217;in \u00e7al\u0131\u015ft\u0131r\u0131labilir dosya uzant\u0131s\u0131 <strong>*.ps1 <\/strong>dir. Bu nedenle a\u015fa\u011f\u0131daki komutlar\u0131 bir text editor ile a\u00e7\u0131p gerekli uzant\u0131 \u015feklinde kaydettikten sonra scripti \u00e7al\u0131\u015fabilir hale getirebiliriz.<\/p>\n<p style=\"padding-left: 30px;\">#This comment row<\/p>\n<p style=\"padding-left: 30px;\">$name = Read-Host &#8220;What is your name ?&#8221;<\/p>\n<p style=\"padding-left: 30px;\">$dateNow = Get-Date<\/p>\n<p style=\"padding-left: 30px;\">$currentDir = pwd<\/p>\n<p style=\"padding-left: 30px;\">Write-Host &#8220;$name &#8211; $dateNow &#8211; $currentDir &#8220;<\/p>\n<p>Scripti \u00e7al\u0131\u015ft\u0131rmak i\u00e7in PowerShell aray\u00fcz\u00fcne girdikten sonra\u00a0<strong>my_script.ps1\u00a0<\/strong>yazmak yeterli olacakt\u0131r. E\u011fer yaz\u0131lan script \u00e7al\u0131\u015fmaz ise gerekli \u00e7al\u0131\u015ft\u0131rma izni verilmemi\u015ftir. \u0130zinleri vermek i\u00e7in <strong>PowerShell aray\u00fcz\u00fcn\u00fc y\u00f6netici olarak \u00e7al\u0131\u015ft\u0131rd\u0131ktan sonra\u00a0<\/strong>a\u015fa\u011f\u0131daki komutu \u00e7al\u0131\u015ft\u0131rmak yeterli olacakt\u0131r.<\/p>\n<p style=\"padding-left: 30px;\">Set-ExecutionPolicy RemoteSigned<\/p>\n<p><span style=\"font-size: 14pt;\"><strong>Ko\u015ful \u0130fadeleri ve D\u00f6ng\u00fcler<\/strong><\/span><\/p>\n<p>Her programlama dilinde oldu\u011fu gibi PowerShell&#8217;de de\u00a0 d\u00f6ng\u00fcler ve ko\u015fullu ifadeler kullan\u0131lmaktad\u0131r. Bunlar\u0131n avantajlar\u0131ndan bahsetmeye gerek yok \ud83d\ude42 . K\u0131saca d\u00f6ng\u00fclerin ve ko\u015fullar\u0131n nas\u0131l olu\u015fturuldu\u011funa bakal\u0131m.<\/p>\n<p><strong>Ko\u015ful \u0130fadesi (if statement)<\/strong><\/p>\n<p style=\"padding-left: 30px;\">\u00a0$var1 = 2<\/p>\n<p style=\"padding-left: 30px;\">$var2 = 5<\/p>\n<p style=\"padding-left: 30px;\">if ($var1 &gt; $var2){<\/p>\n<p style=\"padding-left: 60px;\">Write-Host &#8220;De\u011fer 1 = $var1 daha b\u00fcy\u00fck &#8220;<\/p>\n<p style=\"padding-left: 30px;\">}else{<\/p>\n<p style=\"padding-left: 60px;\">Write-Host &#8220;De\u011fer 2 = $var2 daha b\u00fcy\u00fck &#8220;<\/p>\n<p style=\"padding-left: 30px;\">}<\/p>\n<p><strong>For D\u00f6ng\u00fcs\u00fc (for statement)<\/strong><\/p>\n<p style=\"padding-left: 30px;\">for ([int] $i = 0; $i -lt 10; $i = $i + 1){<\/p>\n<p style=\"padding-left: 60px;\">Write-Host &#8220;i&#8217;nin de\u011feri $i&#8221;<\/p>\n<p style=\"padding-left: 30px;\">}<\/p>\n<p style=\"padding-left: 30px;\">#-lt , -ge, -eq mant\u0131ksal operat\u00f6rlerdir.<strong> -lt (&lt;), -ge(&gt;) ve -eq(==)<\/strong> anlam\u0131nda kullan\u0131lmaktad\u0131r.<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-189 aligncenter\" src=\"http:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/ps1-300x113.png\" alt=\"\" width=\"751\" height=\"283\" srcset=\"https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/ps1-300x113.png 300w, https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/ps1-768x290.png 768w, https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/ps1.png 1024w, https:\/\/talhacelik.com.tr\/wp-content\/uploads\/2018\/04\/ps1-780x295.png 780w\" sizes=\"(max-width: 751px) 100vw, 751px\" \/><\/p>\n<p style=\"text-align: justify;\">Son olarak scripti daha verimli, hatas\u0131z ve h\u0131zl\u0131 yazabilmek i\u00e7in <strong>PowerShell ISE<\/strong> (Integrated Scripting Environment) kullan\u0131lmaktad\u0131r. Bu ISE sayesinde yaz\u0131lan scripti <strong>debug<\/strong> edebilir, <strong>syntax<\/strong> (yaz\u0131m) hatalar\u0131n\u0131 engelleyebilir ve helper sayesinde <strong>t\u00fcm kodlar\u0131n<\/strong> ne i\u015fe yarad\u0131\u011f\u0131n\u0131 ve detaylar\u0131n\u0131 \u00f6\u011frenebilirsiniz.<\/p>\n<p>PS scriptine bir \u00f6rnek: Makinaya ba\u011fl\u0131 olan t\u00fcm cdromlar\u0131n kapaklar\u0131n\u0131 a\u00e7maktad\u0131r.<\/p>\n<pre>param( [string] $help )\r\n\r\nif ( $help -eq \"\" ) {\r\n\tif ( $HOME[0] -eq \"\/\" ) {\r\n\t\t# Linux\r\n\t\teject\r\n\t} else {\r\n\t\t# Windows\r\n\t\t$colCDROMs = ( new-object -COM WMPlayer.OCX.7 ).cdromCollection\r\n\t\tfor ( $i = 0; $i -lt $colCDROMs.count ; $i++ ) { $colCDROMs.Item( $i ).eject( ) }\r\n\t}\r\n}\r\nelse {\r\n\twrite-host\r\n\twrite-host \"CDEject.ps1, Version 1.01\"\r\n\twrite-host \"Eject all CDROMs\"\r\n\twrite-host\r\n\twrite-host \"Requires Windows Media Player in Windows.\"\r\n\tWrite-Host \"Uses native `\"eject`\" command in Linux.\"\r\n\twrite-host\r\n\t\r\n}\r\n\r\n\r\n<\/pre>\n<p>Kaynaklar<\/p>\n<p>[1]\u00a0<a href=\"https:\/\/www.varonis.com\/blog\/windows-powershell-tutorials\/\">https:\/\/www.varonis.com\/blog\/windows-powershell-tutorials<\/a><\/p>\n<p>[2]\u00a0<a href=\"https:\/\/blog.netwrix.com\/2018\/02\/21\/windows-powershell-scripting-tutorial-for-beginners\/\">https:\/\/blog.netwrix.com\/2018\/02\/21\/windows-powershell-scripting-tutorial-for-beginners<\/a><\/p>\n<p>[3] <a href=\"https:\/\/www.czerno.com\/blog\/post\/2016\/08\/26\/powershell-script-to-launch-one-or-more-published-applications-from-citrix-storefront-2-x-through-3-6\">https:\/\/www.czerno.com<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell Nedir ? PowerShell, Windows i\u015fletim sisteminin Windows7 ile geli\u015ftirip piyasaya s\u00fcrd\u00fc\u011f\u00fc, Unix tabanl\u0131 i\u015fletimi sistemlerinde bash yap\u0131s\u0131na benzer, Cmdlet* ler ile y\u00f6netilen .Net yaz\u0131l\u0131m\u0131n\u0131 destekleyen bir programlama dilidir. PowerShell sistem i\u00e7erisinde pratik i\u015flemleri yapmay\u0131 sa\u011flayan, genelde sistem y\u00f6neticileri taraf\u0131ndan olduk\u00e7a ra\u011fbet g\u00f6ren bir programlama dilidir. [*]PowerShell&#8217;in sahip oldu\u011fu komulara verilen isim. PowerShell Kullan\u0131m\u0131 Windows &hellip;<\/p>\n","protected":false},"author":1,"featured_media":193,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[4,33,34,32],"_links":{"self":[{"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/posts\/188"}],"collection":[{"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/comments?post=188"}],"version-history":[{"count":84,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/posts\/188\/revisions"}],"predecessor-version":[{"id":387,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/posts\/188\/revisions\/387"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/media\/193"}],"wp:attachment":[{"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/media?parent=188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/categories?post=188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/tags?post=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}