එතකොට Power Shell කියන්නේ මොකක්ද ?
මෙම Power Shell එකින් කරන්නෙත් key board command හැසිරවිමම තමයි නමුත් command prompt එකින් කල නොහැකි අති සංකිර්ණ ක්රියාකරකම් කරන්න තමයි එක යොදා ගන්නේ
උදාහරණයක් විදියට ඔබට පරිගණකය භාවිතා කර SERIAL PORT එකෙන් data read කරන්න ඔනි නම් ඔබට එය command prompt එක භාවිතා කර කරන්න බැ ඒ සදහා ඔබට Power Shell යොදගන්න වෙනවා...
මෙතැනදී වෙන්නේ command prompt එකට නැති permission එහෙම නැතිනම් access rights Power Shell වෙත windows නිර්මාණ කරුවන් ලබාදීමය.ඔවුන් පවසන පරිදි ලෝකයේ බොහෝදෙනෙක් command prompt එක භාවිතා කරන්න දන්නවා නමුත් Power Shell භාවිතා කරන්න දන්නේ ටික දෙනෙක් ඉතින් command prompt එකට Hardware access කිරීමට permission ලබාදීමෙන් අනවශ්ය ගැටළු ඇතිවීම වැලක්වීමට තමයි මෙම දේ ඔවුන් කරන්නේ.power shell මගින් ඔබට යම්තාක් දුරට windows system function access කිරීමට අවශ්ය permission ලබාදීමක් සිදුකරයි.
එතකොට මේවායේ යොදාගන්න command වෙනස්ද ?
මේ දෙකේ භාවිතා කරන command අතර යම් යම් වෙනස්කම් පවතිනවා නමුත් command prompt එකේ යොදාගන්න බොහෝ command කිසිදු ගැටළුවක් නැතිව power Shell එකේ වැඩ කරනවා
උදාහරණයක් විදියට
Change a Directory
- DOS: cd
- PowerShell: Set-Location
List Files in a Directory
- DOS: dir
- PowerShell: Get-ChildItem
Rename a File:
- DOS: rename
- PowerShell: Rename-Item
System Date:
- DOS: date
- PowerShell: date
System information:
- DOS: systeminfo
- PowerShell: systeminfo
Access Serial Ports:
Writing to a Serial Port
PS> [System.IO.Ports.SerialPort]::getportnames()
COM3
PS> $port= new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one
PS> $port.open()
PS> $port.WriteLine("Hello world")
PS> $port.Close()
Reading from a Serial Port
COM3
PS> $port= new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one
PS> $port.open()
PS> $port.WriteLine("Hello world")
PS> $port.Close()
Reading from a Serial Port
PS> $port= new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one
PS> $port.Open()
PS> $port.ReadLine()
PS> $port.Open()
PS> $port.ReadLine()
මේවා open කරන්නේ කොහොමද ?
Power Shell :
Start Menu > All Programs > Accessories > Windows PowerShell
Command Prompt :
Start Menu > All Programs > Accessories > Command Prompt