{"id":36405,"date":"2025-12-05T14:51:14","date_gmt":"2025-12-05T07:51:14","guid":{"rendered":"https:\/\/interdata.vn\/blog\/?p=36405"},"modified":"2025-12-05T14:51:14","modified_gmt":"2025-12-05T07:51:14","slug":"windows-powershell-la-gi","status":"publish","type":"post","link":"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/","title":{"rendered":"Windows PowerShell l\u00e0 g\u00ec? L\u1ec7nh c\u01a1 b\u1ea3n, L\u1ee3i \u00edch &#038; C\u00e1ch s\u1eed d\u1ee5ng"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-white ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed8I DUNG<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Windows-PowerShell-la-gi\" >Windows PowerShell l\u00e0 g\u00ec?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Windows-PowerShell-ISE-la-gi\" >Windows PowerShell ISE l\u00e0 g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#PowerShell-Core-vs-Windows-PowerShell\" >PowerShell Core vs. Windows PowerShell<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Cac-tinh-nang-chinh-cua-Windows-PowerShell\" >C\u00e1c t\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Windows PowerShell<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Kha-nang-tim-kiem-va-kham-pha-lenh\" >Kh\u1ea3 n\u0103ng t\u00ecm ki\u1ebfm v\u00e0 kh\u00e1m ph\u00e1 l\u1ec7nh<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Kha-nang-tro-giup-tich-hop\" >Kh\u1ea3 n\u0103ng tr\u1ee3 gi\u00fap t\u00edch h\u1ee3p<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Ho-tro-thuc-thi-lenh-tu-xa\" >H\u1ed7 tr\u1ee3 th\u1ef1c thi l\u1ec7nh t\u1eeb xa<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Ket-noi-lenh-bang-Pipeline-Chuoi-quy-trinh\" >K\u1ebft n\u1ed1i l\u1ec7nh b\u1eb1ng Pipeline (Chu\u1ed7i quy tr\u00ecnh)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#So-sanh-PowerShell-va-CMD-Command-Prompt\" >So s\u00e1nh PowerShell v\u00e0 CMD (Command Prompt)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Tai-sao-nen-su-dung-Windows-PowerShell\" >T\u1ea1i sao n\u00ean s\u1eed d\u1ee5ng Windows PowerShell?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Tu-dong-hoa-cac-tac-vu-lap-lai\" >T\u1ef1 \u0111\u1ed9ng h\u00f3a c\u00e1c t\u00e1c v\u1ee5 l\u1eb7p l\u1ea1i<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Truy-cap-sau-vao-Registry-WMI-va-NET\" >Truy c\u1eadp s\u00e2u v\u00e0o Registry, WMI v\u00e0 .NET<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Quan-ly-tu-xa-Remote-Management\" >Qu\u1ea3n l\u00fd t\u1eeb xa (Remote Management)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Windows-PowerShell-giong-Command-Prompt-o-nhung-diem-nao\" >Windows PowerShell gi\u1ed1ng Command Prompt \u1edf nh\u1eefng \u0111i\u1ec3m n\u00e0o?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Top-cac-lenh-PowerShell-co-ban-va-pho-bien-nhat\" >Top c\u00e1c l\u1ec7nh PowerShell c\u01a1 b\u1ea3n v\u00e0 ph\u1ed5 bi\u1ebfn nh\u1ea5t<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#PowerShell-co-nguy-hiem-khong-Co-nen-tat-PowerShell\" >PowerShell c\u00f3 nguy hi\u1ec3m kh\u00f4ng? C\u00f3 n\u00ean t\u1eaft PowerShell?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#PowerShell-co-nguy-hiem-khong\" >PowerShell c\u00f3 nguy hi\u1ec3m kh\u00f4ng?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Co-nen-tat-PowerShell\" >C\u00f3 n\u00ean t\u1eaft PowerShell?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Nhung-ai-thuong-xuyen-su-dung-Windows-PowerShell\" >Nh\u1eefng ai th\u01b0\u1eddng xuy\u00ean s\u1eed d\u1ee5ng Windows PowerShell?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Khi-nao-nen-dung-PowerShell-Use-case-thuc-te\" >Khi n\u00e0o n\u00ean d\u00f9ng PowerShell? (Use-case th\u1ef1c t\u1ebf)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Cach-mo-Windows-PowerShell-tren-Windows-10\" >C\u00e1ch m\u1edf Windows PowerShell tr\u00ean Windows 10<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Huong-dan-su-dung-PowerShell\" >H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng PowerShell<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Cach-chay-cmdlet-trong-PowerShell\" >C\u00e1ch ch\u1ea1y cmdlet trong PowerShell<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Cach-chay-PowerShell-Script\" >C\u00e1ch ch\u1ea1y PowerShell Script<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Sao-luu-co-so-du-lieu-SQL-bang-PowerShell\" >Sao l\u01b0u c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL b\u1eb1ng PowerShell<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/#Cac-lenh-PowerShell-co-ban-can-biet\" >C\u00e1c l\u1ec7nh PowerShell c\u01a1 b\u1ea3n c\u1ea7n bi\u1ebft<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<p>N\u1ebfu b\u1ea1n \u0111ang t\u00ecm c\u00e1ch qu\u1ea3n tr\u1ecb Windows hi\u1ec7u qu\u1ea3 h\u01a1n, t\u1ef1 \u0111\u1ed9ng h\u00f3a c\u00e1c t\u00e1c v\u1ee5 l\u1eb7p l\u1ea1i, hay \u0111\u01a1n gi\u1ea3n ch\u1ec9 mu\u1ed1n hi\u1ec3u v\u00ec sao nhi\u1ec1u h\u01b0\u1edbng d\u1eabn k\u1ef9 thu\u1eadt y\u00eau c\u1ea7u \u201cm\u1edf PowerShell\u201d, th\u00ec ch\u1eafc ch\u1eafn s\u1ebd t\u00ecm hi\u1ec3u qua Windows PowerShell. V\u1eady <strong><a href=\"https:\/\/interdata.vn\/blog\/windows-powershell-la-gi\/\">Windows PowerShell l\u00e0 g\u00ec?<\/a><\/strong> B\u00e0i vi\u1ebft d\u01b0\u1edbi \u0111\u00e2y s\u1ebd gi\u1ea3i \u0111\u00e1p chi ti\u1ebft kh\u00e1i ni\u1ec7m, l\u1ee3i \u00edch, c\u00e1c l\u1ec7nh c\u01a1 b\u1ea3n, ph\u00e2n bi\u1ec7t r\u00f5 r\u00e0ng v\u1edbi CMD v\u00e0 h\u01b0\u1edbng d\u1eabn b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng b\u1ed9 c\u00f4ng c\u1ee5 quy\u1ec1n l\u1ef1c PowerShell \u0111\u1ec3 qu\u1ea3n l\u00fd h\u1ec7 th\u1ed1ng hi\u1ec7u qu\u1ea3 h\u01a1n.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Windows-PowerShell-la-gi\"><\/span>Windows PowerShell l\u00e0 g\u00ec?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong>Windows PowerShell<\/strong> l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd c\u1ea5u h\u00ecnh v\u00e0 t\u1ef1 \u0111\u1ed9ng h\u00f3a t\u00e1c v\u1ee5 \u0111a n\u1ec1n t\u1ea3ng, bao g\u1ed3m m\u1ed9t tr\u00ecnh bao d\u00f2ng l\u1ec7nh (command-line shell) v\u00e0 m\u1ed9t ng\u00f4n ng\u1eef k\u1ecbch b\u1ea3n (scripting language). C\u00f4ng c\u1ee5 n\u00e0y \u0111\u01b0\u1ee3c Microsoft ph\u00e1t tri\u1ec3n d\u1ef1a tr\u00ean n\u1ec1n t\u1ea3ng <strong>.NET Framework<\/strong> m\u1ea1nh m\u1ebd.<\/p>\n<p>Kh\u00e1c v\u1edbi c\u00e1c giao di\u1ec7n d\u00f2ng l\u1ec7nh c\u0169 ch\u1ec9 x\u1eed l\u00fd v\u0103n b\u1ea3n (text), PowerShell l\u00e0m vi\u1ec7c v\u1edbi c\u00e1c <strong>\u0111\u1ed1i t\u01b0\u1ee3ng (objects)<\/strong>. \u0110i\u1ec1u n\u00e0y c\u00f3 ngh\u0129a l\u00e0 d\u1eef li\u1ec7u \u0111\u1ea7u ra c\u1ee7a m\u1ed9t l\u1ec7nh c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c chuy\u1ec3n ti\u1ebfp tr\u1ef1c ti\u1ebfp l\u00e0m d\u1eef li\u1ec7u \u0111\u1ea7u v\u00e0o cho m\u1ed9t l\u1ec7nh kh\u00e1c m\u00e0 kh\u00f4ng c\u1ea7n ph\u1ea3i x\u1eed l\u00fd \u0111\u1ecbnh d\u1ea1ng ph\u1ee9c t\u1ea1p.<\/p>\n<figure id=\"attachment_36413\" aria-describedby=\"caption-attachment-36413\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-36413\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/Windows-PowerShell-la-gi.jpg\" alt=\"Windows PowerShell l\u00e0 g\u00ec\" width=\"800\" height=\"500\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/Windows-PowerShell-la-gi.jpg 800w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/Windows-PowerShell-la-gi-300x188.jpg 300w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/Windows-PowerShell-la-gi-768x480.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption id=\"caption-attachment-36413\" class=\"wp-caption-text\">Windows PowerShell l\u00e0 g\u00ec?<\/figcaption><\/figure>\n<p>M\u00e0u xanh d\u01b0\u01a1ng \u0111\u1eb7c tr\u01b0ng c\u1ee7a giao di\u1ec7n PowerShell \u0111\u01b0\u1ee3c Microsoft thi\u1ebft k\u1ebf c\u00f3 ch\u1ee7 \u0111\u00edch. M\u00e0u s\u1eafc n\u00e0y gi\u00fap ng\u01b0\u1eddi d\u00f9ng ph\u00e2n bi\u1ec7t ngay l\u1eadp t\u1ee9c v\u1edbi m\u00e0n h\u00ecnh m\u00e0u \u0111en c\u1ee7a Command Prompt (CMD) truy\u1ec1n th\u1ed1ng (M\u00e0u xanh d\u01b0\u01a1ng l\u00e0 m\u1eb7c \u0111\u1ecbnh, nh\u01b0ng c\u00f3 th\u1ec3 thay \u0111\u1ed5i. PowerShell 7 d\u00f9ng terminal theo theme h\u1ec7 th\u1ed1ng).<\/p>\n<p>V\u1edbi qu\u1ea3n tr\u1ecb vi\u00ean h\u1ec7 th\u1ed1ng (System Admin), hi\u1ec3u r\u00f5 <strong>c\u00f4ng c\u1ee5<\/strong> <strong>Windows PowerShell l\u00e0 g\u00ec<\/strong> ch\u00ednh l\u00e0 ch\u00eca kh\u00f3a \u0111\u1ec3 ki\u1ec3m so\u00e1t to\u00e0n b\u1ed9 m\u00f4i tr\u01b0\u1eddng Windows, t\u1eeb vi\u1ec7c t\u1ea1o t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng h\u00e0ng lo\u1ea1t cho \u0111\u1ebfn qu\u1ea3n l\u00fd m\u00e1y ch\u1ee7 \u0111\u00e1m m\u00e2y Azure.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Windows-PowerShell-ISE-la-gi\"><\/span>Windows PowerShell ISE l\u00e0 g\u00ec?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Khi t\u00ecm hi\u1ec3u <strong>Windows PowerShell<\/strong>, b\u1ea1n s\u1ebd th\u01b0\u1eddng th\u1ea5y thu\u1eadt ng\u1eef <strong>PowerShell ISE<\/strong>. \u0110\u00e2y l\u00e0 vi\u1ebft t\u1eaft c\u1ee7a <strong>Integrated Scripting Environment<\/strong> (M\u00f4i tr\u01b0\u1eddng k\u1ecbch b\u1ea3n t\u00edch h\u1ee3p).<\/p>\n<p>N\u1ebfu PowerShell Console (m\u00e0n h\u00ecnh xanh) l\u00e0 n\u01a1i b\u1ea1n g\u00f5 t\u1eebng l\u1ec7nh v\u00e0 ch\u1ea1y ngay l\u1eadp t\u1ee9c, th\u00ec PowerShell ISE gi\u1ed1ng nh\u01b0 m\u1ed9t tr\u00ecnh so\u1ea1n th\u1ea3o v\u0103n b\u1ea3n cao c\u1ea5p d\u00e0nh ri\u00eang cho code. ISE cung c\u1ea5p giao di\u1ec7n \u0111\u1ed3 h\u1ecda cho ph\u00e9p b\u1ea1n vi\u1ebft, ch\u1ea1y th\u1eed nghi\u1ec7m (test) v\u00e0 g\u1ee1 l\u1ed7i (debug) c\u00e1c \u0111o\u1ea1n script ph\u1ee9c t\u1ea1p.<\/p>\n<p>C\u00e1c t\u00ednh n\u0103ng n\u1ed5i b\u1eadt c\u1ee7a PowerShell ISE bao g\u1ed3m:<\/p>\n<ul>\n<li>T\u00f4 m\u00e0u c\u00fa ph\u00e1p (gi\u00fap d\u1ec5 nh\u00ecn code).<\/li>\n<li>G\u1ee3i \u00fd l\u1ec7nh th\u00f4ng minh (IntelliSense).<\/li>\n<li>M\u1edf nhi\u1ec1u tab \u0111\u1ec3 l\u00e0m vi\u1ec7c v\u1edbi nhi\u1ec1u script c\u00f9ng l\u00fac.<\/li>\n<\/ul>\n<p>\u0110\u1ed1i v\u1edbi ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u h\u1ecdc vi\u1ebft script, s\u1eed d\u1ee5ng ISE s\u1ebd tr\u1ef1c quan v\u00e0 d\u1ec5 d\u00e0ng h\u01a1n nhi\u1ec1u so v\u1edbi vi\u1ec7c vi\u1ebft code tr\u00ean Notepad r\u1ed3i ch\u1ea1y tr\u00ean Console.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"PowerShell-Core-vs-Windows-PowerShell\"><\/span>PowerShell Core vs. Windows PowerShell<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>L\u1ecbch s\u1eed ph\u00e1t tri\u1ec3n c\u1ee7a PowerShell chia l\u00e0m hai giai \u0111o\u1ea1n ch\u00ednh m\u00e0 ng\u01b0\u1eddi d\u00f9ng c\u1ea7n n\u1eafm r\u00f5:<\/p>\n<ol>\n<li><strong>Windows PowerShell (Phi\u00ean b\u1ea3n 1.0 \u0111\u1ebfn 5.1):<\/strong> \u0110\u01b0\u1ee3c x\u00e2y d\u1ef1ng tr\u00ean .NET Framework c\u0169. Phi\u00ean b\u1ea3n n\u00e0y ch\u1ec9 ch\u1ea1y \u0111\u1ed9c quy\u1ec1n tr\u00ean h\u1ec7 \u0111i\u1ec1u h\u00e0nh Windows. \u0110\u00e2y l\u00e0 phi\u00ean b\u1ea3n \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t s\u1eb5n tr\u00ean h\u1ea7u h\u1ebft c\u00e1c m\u00e1y t\u00ednh Windows 10, Windows 11 hi\u1ec7n nay.<\/li>\n<li><strong>PowerShell Core (Phi\u00ean b\u1ea3n 6.0 tr\u1edf l\u00ean):<\/strong> \u0110\u01b0\u1ee3c x\u00e2y d\u1ef1ng tr\u00ean .NET Core. \u0110\u00e2y l\u00e0 phi\u00ean b\u1ea3n m\u00e3 ngu\u1ed3n m\u1edf v\u00e0 \u0111a n\u1ec1n t\u1ea3ng. B\u1ea1n c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t v\u00e0 ch\u1ea1y PowerShell Core tr\u00ean c\u1ea3 Linux v\u00e0 macOS.<\/li>\n<\/ol>\n<p>Hi\u1ec7n nay, Microsoft \u0111ang t\u1eadp trung ph\u00e1t tri\u1ec3n PowerShell Core (nay g\u1ecdi t\u1eaft l\u00e0 PowerShell) \u0111\u1ec3 ph\u1ee5c v\u1ee5 xu h\u01b0\u1edbng qu\u1ea3n tr\u1ecb \u0111a n\u1ec1n t\u1ea3ng. Tuy nhi\u00ean, n\u1ebfu b\u1ea1n ch\u1ec9 qu\u1ea3n tr\u1ecb Windows thu\u1ea7n t\u00fay, phi\u00ean b\u1ea3n Windows PowerShell 7 tr\u1edf l\u00ean c\u00f3 s\u1eb5n v\u1eabn l\u00e0 c\u00f4ng c\u1ee5 \u1ed5n \u0111\u1ecbnh v\u00e0 \u0111\u1ea7y \u0111\u1ee7 ch\u1ee9c n\u0103ng nh\u1ea5t.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cac-tinh-nang-chinh-cua-Windows-PowerShell\"><\/span><strong>C\u00e1c t\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Windows PowerShell<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Microsoft li\u00ean t\u1ee5c b\u1ed5 sung c\u1ea3i ti\u1ebfn v\u00e0 t\u00ednh n\u0103ng m\u1edbi cho t\u1eebng phi\u00ean b\u1ea3n PowerShell. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 nh\u1eefng \u0111\u1eb7c \u0111i\u1ec3m quan tr\u1ecdng nh\u1ea5t m\u00e0 b\u1ea1n c\u1ea7n n\u1eafm khi t\u00ecm hi\u1ec3u c\u00f4ng c\u1ee5 PowerShell.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Kha-nang-tim-kiem-va-kham-pha-lenh\"><\/span><strong>Kh\u1ea3 n\u0103ng t\u00ecm ki\u1ebfm v\u00e0 kh\u00e1m ph\u00e1 l\u1ec7nh<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Ng\u01b0\u1eddi d\u00f9ng c\u00f3 th\u1ec3 kh\u00e1m ph\u00e1 to\u00e0n b\u1ed9 t\u00ednh n\u0103ng trong PowerShell b\u1eb1ng c\u00e1c cmdlet nh\u01b0 <strong>Get-Command<\/strong>, gi\u00fap hi\u1ec3n th\u1ecb danh s\u00e1ch m\u1ecdi l\u1ec7nh, bao g\u1ed3m cmdlet v\u00e0 h\u00e0m hi\u1ec7n c\u00f3 tr\u00ean m\u00e1y. B\u1ea1n c\u0169ng c\u00f3 th\u1ec3 th\u00eam tham s\u1ed1 \u0111\u1ec3 thu h\u1eb9p ph\u1ea1m vi t\u00ecm ki\u1ebfm t\u00f9y theo nhu c\u1ea7u.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Kha-nang-tro-giup-tich-hop\"><\/span><strong>Kh\u1ea3 n\u0103ng tr\u1ee3 gi\u00fap t\u00edch h\u1ee3p<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u0110\u1ec3 t\u00ecm hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1 ho\u1ea1t \u0111\u1ed9ng c\u1ee7a PowerShell ho\u1eb7c tra c\u1ee9u th\u00f4ng tin chi ti\u1ebft c\u1ee7a t\u1eebng cmdlet, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng <strong>Get-Help<\/strong>. Khi th\u00eam tham s\u1ed1 <strong>-online<\/strong>, PowerShell s\u1ebd m\u1edf c\u00e1c t\u00e0i li\u1ec7u h\u01b0\u1edbng d\u1eabn t\u01b0\u01a1ng \u1ee9ng tr\u00ean web n\u1ebfu ch\u1ee7 \u0111\u1ec1 \u0111\u00f3 c\u00f3 h\u1ed7 tr\u1ee3.<\/p>\n<figure id=\"attachment_36415\" aria-describedby=\"caption-attachment-36415\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-36415\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/Tinh-nang-chinh-cua-Windows-PowerShell.jpg\" alt=\"T\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Windows PowerShell\" width=\"800\" height=\"500\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/Tinh-nang-chinh-cua-Windows-PowerShell.jpg 800w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/Tinh-nang-chinh-cua-Windows-PowerShell-300x188.jpg 300w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/Tinh-nang-chinh-cua-Windows-PowerShell-768x480.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption id=\"caption-attachment-36415\" class=\"wp-caption-text\">T\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Windows PowerShell<\/figcaption><\/figure>\n<h3><span class=\"ez-toc-section\" id=\"Ho-tro-thuc-thi-lenh-tu-xa\"><\/span><strong>H\u1ed7 tr\u1ee3 th\u1ef1c thi l\u1ec7nh t\u1eeb xa<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>PowerShell cho ph\u00e9p qu\u1ea3n tr\u1ecb vi\u00ean ch\u1ea1y l\u1ec7nh ho\u1eb7c th\u1ef1c hi\u1ec7n t\u00e1c v\u1ee5 t\u1eeb xa tr\u00ean m\u1ed9t ho\u1eb7c nhi\u1ec1u m\u00e1y t\u00ednh th\u00f4ng qua c\u00e1c c\u00f4ng ngh\u1ec7 nh\u01b0 <strong>WMI<\/strong> v\u00e0 <strong>WS-Management<\/strong>. V\u00ed d\u1ee5: giao th\u1ee9c WS-Management gi\u00fap b\u1ea1n k\u00edch ho\u1ea1t l\u1ec7nh ho\u1eb7c script PowerShell t\u1eeb xa m\u00e0 kh\u00f4ng c\u1ea7n thao t\u00e1c tr\u1ef1c ti\u1ebfp tr\u00ean t\u1eebng thi\u1ebft b\u1ecb.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Ket-noi-lenh-bang-Pipeline-Chuoi-quy-trinh\"><\/span><strong>K\u1ebft n\u1ed1i l\u1ec7nh b\u1eb1ng Pipeline (Chu\u1ed7i quy tr\u00ecnh)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>PowerShell cho ph\u00e9p k\u1ebft n\u1ed1i nhi\u1ec1u l\u1ec7nh l\u1ea1i v\u1edbi nhau b\u1eb1ng to\u00e1n t\u1eed pipe (<strong>|<\/strong>), gi\u00fap xu\u1ea5t d\u1eef li\u1ec7u t\u1eeb l\u1ec7nh tr\u01b0\u1edbc l\u00e0m \u0111\u1ea7u v\u00e0o cho l\u1ec7nh ti\u1ebfp theo. Kh\u00e1c v\u1edbi Command Prompt, PowerShell truy\u1ec1n c\u00e1c <strong>\u0111\u1ed1i t\u01b0\u1ee3ng<\/strong> thay v\u00ec ch\u1ec9 l\u00e0 v\u0103n b\u1ea3n thu\u1ea7n. \u0110\u00e2y l\u00e0 y\u1ebfu t\u1ed1 quan tr\u1ecdng gi\u00fap x\u00e2y d\u1ef1ng c\u00e1c k\u1ecbch b\u1ea3n t\u1ef1 \u0111\u1ed9ng h\u00f3a chi ti\u1ebft v\u00e0 ph\u1ee9c t\u1ea1p.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"So-sanh-PowerShell-va-CMD-Command-Prompt\"><\/span>So s\u00e1nh PowerShell v\u00e0 CMD (Command Prompt)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>R\u1ea5t nhi\u1ec1u ng\u01b0\u1eddi d\u00f9ng, \u0111\u1eb7c bi\u1ec7t l\u00e0 nh\u00f3m sinh vi\u00ean IT m\u1edbi nh\u1eadp m\u00f4n, th\u01b0\u1eddng nh\u1ea7m l\u1eabn ho\u1eb7c kh\u00f4ng bi\u1ebft n\u00ean ch\u1ecdn c\u00f4ng c\u1ee5 n\u00e0o. Vi\u1ec7c hi\u1ec3u r\u00f5\u00a0Windows PowerShell l\u00e0 g\u00ec\u00a0v\u00e0 n\u00f3 kh\u00e1c bi\u1ec7t ra sao v\u1edbi CMD s\u1ebd gi\u00fap b\u1ea1n ch\u1ecdn \u0111\u00fang c\u00f4ng c\u1ee5 cho c\u00f4ng vi\u1ec7c.<\/p>\n<p>D\u01b0\u1edbi \u0111\u00e2y l\u00e0 b\u1ea3ng so s\u00e1nh chi ti\u1ebft d\u1ef1a tr\u00ean c\u00e1c \u0111\u1eb7c t\u00ednh k\u1ef9 thu\u1eadt:<\/p>\n<table style=\"width: 100%; border-collapse: collapse; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; box-shadow: 0 6px 18px rgba(12,64,244,0.08);\" role=\"table\">\n<thead>\n<tr>\n<th style=\"text-align: left; padding: 14px 12px; border-radius: 8px 0 0 8px; background: linear-gradient(90deg,#0C40F4 0%,#077FFA 50%,#0497FC 100%); color: #fff; font-weight: bold; font-size: 15px;\">Ti\u00eau ch\u00ed<\/th>\n<th style=\"text-align: left; padding: 14px 12px; background: linear-gradient(90deg,#0C40F4 0%,#077FFA 50%,#0497FC 100%); color: #fff; font-weight: bold; font-size: 15px;\">Command Prompt (CMD)<\/th>\n<th style=\"text-align: left; padding: 14px 12px; border-radius: 0 8px 8px 0; background: linear-gradient(90deg,#0C40F4 0%,#077FFA 50%,#0497FC 100%); color: #fff; font-weight: bold; font-size: 15px;\">Windows PowerShell<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.08); font-weight: 600; background: #ffffff;\">N\u1ec1n t\u1ea3ng<\/td>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.06); background: #fbfdff;\">D\u1ef1a tr\u00ean h\u1ec7 \u0111i\u1ec1u h\u00e0nh DOS c\u0169 (t\u1eeb nh\u1eefng n\u0103m 1980).<\/td>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.06); background: #fbfdff;\">D\u1ef1a tr\u00ean .NET Framework hi\u1ec7n \u0111\u1ea1i.<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.08); font-weight: 600; background: #ffffff;\">D\u1eef li\u1ec7u x\u1eed l\u00fd<\/td>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.06); background: #fff;\">D\u1ef1a tr\u00ean v\u0103n b\u1ea3n (Text-based). K\u1ebft qu\u1ea3 tr\u1ea3 v\u1ec1 l\u00e0 c\u00e1c d\u00f2ng ch\u1eef.<\/td>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.06); background: #fff;\">D\u1ef1a tr\u00ean \u0111\u1ed1i t\u01b0\u1ee3ng (Object-based). K\u1ebft qu\u1ea3 tr\u1ea3 v\u1ec1 l\u00e0 c\u00e1c \u0111\u1ed1i t\u01b0\u1ee3ng d\u1eef li\u1ec7u th\u1ef1c s\u1ef1.<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.08); font-weight: 600; background: #ffffff;\">C\u00fa ph\u00e1p l\u1ec7nh<\/td>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.06); background: #fbfdff;\">L\u1ec7nh \u0111\u01a1n gi\u1ea3n, ng\u1eafn g\u1ecdn nh\u01b0ng kh\u00f3 nh\u1edb (v\u00ed d\u1ee5: dir, ping).<\/td>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.06); background: #fbfdff;\">C\u00fa ph\u00e1p Verb-Noun (\u0110\u1ed9ng t\u1eeb-Danh t\u1eeb) d\u1ec5 hi\u1ec3u (v\u00ed d\u1ee5: Get-ChildItem, Test-Connection).<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.08); font-weight: 600; background: #ffffff;\">Kh\u1ea3 n\u0103ng Scripting<\/td>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.06); background: #fff;\">H\u1ea1n ch\u1ebf. Ch\u1ec9 vi\u1ebft \u0111\u01b0\u1ee3c c\u00e1c file .bat \u0111\u01a1n gi\u1ea3n.<\/td>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.06); background: #fff;\">R\u1ea5t m\u1ea1nh m\u1ebd. Vi\u1ebft \u0111\u01b0\u1ee3c c\u00e1c script .ps1 ph\u1ee9c t\u1ea1p, h\u1ed7 tr\u1ee3 bi\u1ebfn, h\u00e0m, v\u00f2ng l\u1eb7p.<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.08); font-weight: 600; background: #ffffff;\">Cmdlets<\/td>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.06); background: #fbfdff;\">Kh\u00f4ng h\u1ed7 tr\u1ee3 Cmdlets.<\/td>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.06); background: #fbfdff;\">S\u1edf h\u1eefu th\u01b0 vi\u1ec7n h\u00e0ng ngh\u00ecn Cmdlets (l\u1ec7nh nh\u1ecf) t\u00edch h\u1ee3p s\u1eb5n.<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.08); font-weight: 600; border-radius: 0 0 0 8px; background: #ffffff;\">Quy\u1ec1n qu\u1ea3n tr\u1ecb<\/td>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.06); border-radius: 0 0 8px 0; background: #fff;\">Gi\u1edbi h\u1ea1n trong c\u00e1c t\u00e1c v\u1ee5 c\u01a1 b\u1ea3n.<\/td>\n<td style=\"vertical-align: top; padding: 12px; border: 1px solid rgba(12,64,244,0.06); border-radius: 0 0 0 8px; background: #fff;\">Truy c\u1eadp s\u00e2u v\u00e0o Registry, WMI, Active Directory, Exchange&#8230;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>K\u1ebft lu\u1eadn:<\/strong><\/p>\n<ul>\n<li>B\u1ea1n n\u00ean d\u00f9ng <strong>CMD<\/strong> khi: C\u1ea7n ch\u1ea1y c\u00e1c l\u1ec7nh ki\u1ec3m tra m\u1ea1ng nhanh (ping, ipconfig) ho\u1eb7c c\u00e1c thao t\u00e1c file \u0111\u01a1n gi\u1ea3n m\u00e0 kh\u00f4ng mu\u1ed1n nh\u1edb c\u00fa ph\u00e1p d\u00e0i d\u00f2ng.<\/li>\n<li>B\u1ea1n n\u00ean d\u00f9ng <strong>PowerShell<\/strong> khi: C\u1ea7n qu\u1ea3n tr\u1ecb h\u1ec7 th\u1ed1ng chuy\u00ean s\u00e2u, t\u1ef1 \u0111\u1ed9ng h\u00f3a c\u00f4ng vi\u1ec7c, l\u1ecdc v\u00e0 x\u1eed l\u00fd d\u1eef li\u1ec7u ph\u1ee9c t\u1ea1p.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Tai-sao-nen-su-dung-Windows-PowerShell\"><\/span>T\u1ea1i sao n\u00ean s\u1eed d\u1ee5ng Windows PowerShell?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>N\u1ebfu CMD v\u1eabn ho\u1ea1t \u0111\u1ed9ng t\u1ed1t, t\u1ea1i sao Microsoft l\u1ea1i ph\u1ea3i t\u1ea1o ra PowerShell v\u00e0 khuy\u1ebfn kh\u00edch m\u1ecdi ng\u01b0\u1eddi t\u00ecm hi\u1ec3u c\u00f4ng c\u1ee5 Windows PowerShell?\u00a0C\u00e2u tr\u1ea3 l\u1eddi n\u1eb1m \u1edf kh\u1ea3 n\u0103ng m\u1edf r\u1ed9ng v\u00e0 t\u1ef1 \u0111\u1ed9ng h\u00f3a kh\u00f4ng gi\u1edbi h\u1ea1n.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Tu-dong-hoa-cac-tac-vu-lap-lai\"><\/span>T\u1ef1 \u0111\u1ed9ng h\u00f3a c\u00e1c t\u00e1c v\u1ee5 l\u1eb7p l\u1ea1i<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u0110\u00e2y l\u00e0 &#8220;v\u0169 kh\u00ed&#8221; m\u1ea1nh nh\u1ea5t c\u1ee7a PowerShell. Gi\u1ea3 s\u1eed b\u1ea1n l\u00e0 m\u1ed9t nh\u00e2n vi\u00ean qu\u1ea3n tr\u1ecb m\u1ea1ng t\u1ea1i doanh nghi\u1ec7p v\u00e0 s\u1ebfp y\u00eau c\u1ea7u t\u1ea1o 100 th\u01b0 m\u1ee5c m\u1edbi cho 100 nh\u00e2n vi\u00ean, \u0111\u1eb7t t\u00ean theo m\u00e3 s\u1ed1 nh\u00e2n vi\u00ean.<\/p>\n<ul>\n<li>V\u1edbi c\u00e1ch th\u1ee7 c\u00f4ng: B\u1ea1n ph\u1ea3i chu\u1ed9t ph\u1ea3i -&gt; New Folder -&gt; \u0110\u1ed5i t\u00ean (100 l\u1ea7n).<\/li>\n<li>V\u1edbi PowerShell: B\u1ea1n ch\u1ec9 c\u1ea7n vi\u1ebft m\u1ed9t d\u00f2ng l\u1ec7nh duy nh\u1ea5t, c\u00f4ng vi\u1ec7c ho\u00e0n th\u00e0nh trong ch\u01b0a \u0111\u1ea7y 1 gi\u00e2y.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Truy-cap-sau-vao-Registry-WMI-va-NET\"><\/span>Truy c\u1eadp s\u00e2u v\u00e0o Registry, WMI v\u00e0 .NET<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>PowerShell cho ph\u00e9p b\u1ea1n can thi\u1ec7p v\u00e0o nh\u1eefng &#8220;ng\u00f3c ng\u00e1ch&#8221; s\u00e2u nh\u1ea5t c\u1ee7a h\u1ec7 \u0111i\u1ec1u h\u00e0nh m\u00e0 giao di\u1ec7n Windows (GUI) kh\u00f4ng hi\u1ec3n th\u1ecb. B\u1ea1n c\u00f3 th\u1ec3 ch\u1ec9nh s\u1eeda Registry, truy xu\u1ea5t th\u00f4ng tin ph\u1ea7n c\u1ee9ng qua WMI (Windows Management Instrumentation) ho\u1eb7c g\u1ecdi tr\u1ef1c ti\u1ebfp c\u00e1c th\u01b0 vi\u1ec7n .NET \u0111\u1ec3 vi\u1ebft \u1ee9ng d\u1ee5ng nh\u1ecf ngay tr\u00ean d\u00f2ng l\u1ec7nh.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Quan-ly-tu-xa-Remote-Management\"><\/span>Qu\u1ea3n l\u00fd t\u1eeb xa (Remote Management)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Giao th\u1ee9c WinRM (Windows Remote Management) t\u00edch h\u1ee3p trong PowerShell cho ph\u00e9p qu\u1ea3n tr\u1ecb vi\u00ean ng\u1ed3i t\u1ea1i m\u1ed9t m\u00e1y t\u00ednh nh\u01b0ng c\u00f3 th\u1ec3 g\u1eedi l\u1ec7nh \u0111\u1ec3 th\u1ef1c thi tr\u00ean h\u00e0ng tr\u0103m m\u00e1y ch\u1ee7 kh\u00e1c nhau c\u00f9ng l\u00fac.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Windows-PowerShell-giong-Command-Prompt-o-nhung-diem-nao\"><\/span>Windows PowerShell gi\u1ed1ng Command Prompt \u1edf nh\u1eefng \u0111i\u1ec3m n\u00e0o?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Khi m\u1edbi l\u00e0m quen v\u1edbi c\u00f4ng c\u1ee5 PowerShell, nhi\u1ec1u ng\u01b0\u1eddi th\u01b0\u1eddng c\u1ea3m th\u1ea5y h\u01a1i \u201cng\u1ee3p\u201d v\u00ec ph\u1ea3i ti\u1ebfp c\u1eadn m\u1ed9t b\u1ed9 l\u1ec7nh ho\u00e0n to\u00e0n m\u1edbi. Tuy v\u1eady, \u0111i\u1ec1u m\u00e0 ph\u1ea7n l\u1edbn ng\u01b0\u1eddi d\u00f9ng ch\u01b0a nh\u1eadn ra l\u00e0 Windows PowerShell v\u1eabn h\u1ed7 tr\u1ee3 c\u00fa ph\u00e1p quen thu\u1ed9c t\u1eeb d\u00f2ng l\u1ec7nh truy\u1ec1n th\u1ed1ng c\u1ee7a Windows. \u0110i\u1ec1u n\u00e0y tr\u1edf n\u00ean thu\u1eadn ti\u1ec7n h\u01a1n n\u1eefa nh\u1edd vi\u1ec7c PowerShell kh\u00f4ng ph\u00e2n bi\u1ec7t ch\u1eef hoa v\u00e0 ch\u1eef th\u01b0\u1eddng.<\/p>\n<p>T\u01b0\u01a1ng t\u1ef1 nh\u01b0 Command Prompt, b\u1ea1n v\u1eabn c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh cd \u0111\u1ec3 chuy\u1ec3n th\u01b0 m\u1ee5c v\u00e0 dir \u0111\u1ec3 xem danh s\u00e1ch t\u1ec7p trong th\u01b0 m\u1ee5c hi\u1ec7n t\u1ea1i. V\u00ec v\u1eady, b\u1ea1n kh\u00f4ng c\u1ea7n ph\u1ea3i b\u1eaft \u0111\u1ea7u l\u1ea1i t\u1eeb con s\u1ed1 0 khi chuy\u1ec3n sang PowerShell.<\/p>\n<p>Tuy nhi\u00ean, c\u0169ng c\u1ea7n nh\u1edb r\u1eb1ng c\u00e1c l\u1ec7nh quen thu\u1ed9c n\u00e0y trong PowerShell ch\u1ec9 \u0111\u01b0\u1ee3c xem nh\u01b0 alias \u2013 t\u1ee9c \u201cb\u00ed danh\u201d, ch\u1ee9 kh\u00f4ng ph\u1ea3i l\u1ec7nh g\u1ed1c. D\u00f9 b\u1ea1n c\u00f3 th\u1ec3 ch\u1ea1y m\u1ed9t s\u1ed1 l\u1ec7nh c\u1ee7a Command Prompt trong PowerShell, t\u1ed1t nh\u1ea5t v\u1eabn n\u00ean d\u00e0nh th\u1eddi gian l\u00e0m quen v\u1edbi c\u00e1c l\u1ec7nh PowerShell m\u1edbi. D\u1eabu v\u1eady, kinh nghi\u1ec7m s\u1eed d\u1ee5ng Command Prompt tr\u01b0\u1edbc \u0111\u00e2y ch\u1eafc ch\u1eafn s\u1ebd gi\u00fap ng\u01b0\u1eddi m\u1edbi d\u1ec5 n\u1eafm b\u1eaft PowerShell h\u01a1n.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Top-cac-lenh-PowerShell-co-ban-va-pho-bien-nhat\"><\/span>Top c\u00e1c l\u1ec7nh PowerShell c\u01a1 b\u1ea3n v\u00e0 ph\u1ed5 bi\u1ebfn nh\u1ea5t<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u0110\u1ec3 th\u1ef1c s\u1ef1 hi\u1ec3u v\u1ec1 c\u00f4ng c\u1ee5 PowerShell, c\u00e1ch t\u1ed1t nh\u1ea5t l\u00e0 b\u1eaft tay v\u00e0o th\u1ef1c h\u00e0nh. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 danh s\u00e1ch c\u00e1c l\u1ec7nh (Cmdlets) thi\u1ebft y\u1ebfu, \u0111\u01b0\u1ee3c InterData ch\u1ecdn l\u1ecdc cho c\u1ea3 ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u v\u00e0 c\u00e1c qu\u1ea3n tr\u1ecb vi\u00ean t\u1eadp s\u1ef1.<\/p>\n<div style=\"overflow-x: auto;\">\n<table style=\"width: 100%; min-width: 800px; border-collapse: collapse; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; box-shadow: 0 6px 18px rgba(12,64,244,0.06);\" role=\"table\">\n<thead>\n<tr>\n<th style=\"text-align: left; padding: 12px 14px; color: #fff; font-weight: bold; font-size: 14px; background: linear-gradient(90deg,#0C40F4 0%,#077FFA 50%,#0497FC 100%); border: 1px solid rgba(7,127,250,0.12; border-bottom: 0;\">No.<\/th>\n<th style=\"text-align: left; padding: 12px 14px; color: #fff; font-weight: bold; font-size: 14px; background: linear-gradient(90deg,#0C40F4 0%,#077FFA 50%,#0497FC 100%); border: 1px solid rgba(7,127,250,0.12; border-bottom: 0;\">Command name<\/th>\n<th style=\"text-align: left; padding: 12px 14px; color: #fff; font-weight: bold; font-size: 14px; background: linear-gradient(90deg,#0C40F4 0%,#077FFA 50%,#0497FC 100%); border: 1px solid rgba(7,127,250,0.12; border-bottom: 0;\">Alias<\/th>\n<th style=\"text-align: left; padding: 12px 14px; color: #fff; font-weight: bold; font-size: 14px; background: linear-gradient(90deg,#0C40F4 0%,#077FFA 50%,#0497FC 100%); border: 1px solid rgba(7,127,250,0.12; border-bottom: 0;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">1<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Set-Location<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">cd, chdir, sl<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Sets the current working location to a specified location.<\/td>\n<\/tr>\n<tr style=\"background: #fbfdff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">2<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Get-Content<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">cat, gc, type<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Gets the content of the item at the specified location.<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">3<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Add-Content<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">ac<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Adds content to the specified items, such as adding words to a file.<\/td>\n<\/tr>\n<tr style=\"background: #fbfdff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">4<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Set-Content<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">sc<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Writes or replaces the content in an item with new content.<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">5<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Copy-Item<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">copy, cp, cpi<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Copies an item from one location to another.<\/td>\n<\/tr>\n<tr style=\"background: #fbfdff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">6<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Remove-Item<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">del, erase, rd, ri, rm, rmdir<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Deletes the specified items.<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">7<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Move-Item<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">mi, move, mv<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Moves an item from one location to another.<\/td>\n<\/tr>\n<tr style=\"background: #fbfdff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">8<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Set-Item<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">si<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Changes the value of an item to the value specified in the command.<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">9<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">New-Item<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">ni<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Creates a new item.<\/td>\n<\/tr>\n<tr style=\"background: #fbfdff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">10<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Start-Job<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">sajb<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Starts a Windows PowerShell background job.<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">11<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Compare-Object<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">compare, dif<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Compares two sets of objects.<\/td>\n<\/tr>\n<tr style=\"background: #fbfdff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">12<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Group-Object<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">group<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Groups objects that contain the same value for specified properties.<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">13<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Invoke-WebRequest<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">curl, iwr, wget<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Gets content from a web page on the Internet.<\/td>\n<\/tr>\n<tr style=\"background: #fbfdff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">14<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Measure-Object<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">measure<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Calculates the numeric properties of objects, and the characters, words, and lines in string objects, such as files \u2026<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">15<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Resolve-Path<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">rvpa<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Resolves the wildcard characters in a path, and displays the path contents.<\/td>\n<\/tr>\n<tr style=\"background: #fbfdff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">16<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Resume-Job<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">rujb<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Restarts a suspended job<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">17<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Set-Variable<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">set, sv<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Sets the value of a variable. Creates the variable if one with the requested name does not exist.<\/td>\n<\/tr>\n<tr style=\"background: #fbfdff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">18<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Show-Command<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">shcm<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Creates Windows PowerShell commands in a graphical command window.<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">19<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Sort-Object<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">sort<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Sorts objects by property values.<\/td>\n<\/tr>\n<tr style=\"background: #fbfdff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">20<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Start-Service<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">sasv<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Starts one or more stopped services.<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">21<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Start-Process<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">saps, start<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Starts one or more processes on the local computer.<\/td>\n<\/tr>\n<tr style=\"background: #fbfdff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">22<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Suspend-Job<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">sujb<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Temporarily stops workflow jobs.<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">23<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Wait-Job<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">wjb<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Suppresses the command prompt until one or all of the Windows PowerShell background jobs running in the session are \u2026<\/td>\n<\/tr>\n<tr style=\"background: #fbfdff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600;\">24<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Where-Object<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">?, where<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Selects objects from a collection based on their property values.<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); font-weight: 600; border-radius: 0 0 0 8px;\">25<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06); border-radius: 0 0 8px 0;\">Write-Output<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">echo, write<\/td>\n<td style=\"padding: 10px 14px; border: 1px solid rgba(12,64,244,0.06);\">Sends the specified objects to the next command in the pipeline. If the command is the last command in the pipeline,\u2026<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"PowerShell-co-nguy-hiem-khong-Co-nen-tat-PowerShell\"><\/span>PowerShell c\u00f3 nguy hi\u1ec3m kh\u00f4ng? C\u00f3 n\u00ean t\u1eaft PowerShell?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Khi t\u00ecm ki\u1ebfm th\u00f4ng tin <strong>Windows PowerShell l\u00e0 g\u00ec<\/strong>, nhi\u1ec1u ng\u01b0\u1eddi d\u00f9ng th\u1ea5y c\u00e1c b\u00e0i vi\u1ebft c\u1ea3nh b\u00e1o v\u1ec1 vi\u1ec7c hacker s\u1eed d\u1ee5ng PowerShell \u0111\u1ec3 t\u1ea5n c\u00f4ng. \u0110i\u1ec1u n\u00e0y d\u1eabn \u0111\u1ebfn t\u00e2m l\u00fd lo s\u1ee3 v\u00e0 mu\u1ed1n g\u1ee1 b\u1ecf c\u00f4ng c\u1ee5 n\u00e0y.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"PowerShell-co-nguy-hiem-khong\"><\/span>PowerShell c\u00f3 nguy hi\u1ec3m kh\u00f4ng?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>B\u1ea3n th\u00e2n Windows PowerShell <strong>kh\u00f4ng ph\u1ea3i l\u00e0 virus<\/strong> v\u00e0 kh\u00f4ng nguy hi\u1ec3m. N\u00f3 l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 qu\u1ea3n tr\u1ecb h\u1ee3p ph\u00e1p v\u00e0 ch\u00ednh ch\u1ee7 c\u1ee7a Microsoft.<\/p>\n<p>Tuy nhi\u00ean, v\u00ec PowerShell qu\u00e1 m\u1ea1nh m\u1ebd (c\u00f3 th\u1ec3 can thi\u1ec7p s\u00e2u v\u00e0o h\u1ec7 th\u1ed1ng), tin t\u1eb7c th\u01b0\u1eddng l\u1ee3i d\u1ee5ng c\u00f4ng c\u1ee5 n\u00e0y \u0111\u1ec3 th\u1ef1c thi c\u00e1c m\u00e3 \u0111\u1ed9c h\u1ea1i. H\u00ecnh th\u1ee9c t\u1ea5n c\u00f4ng n\u00e0y g\u1ecdi l\u00e0 &#8220;Fileless Malware&#8221; (M\u00e3 \u0111\u1ed9c kh\u00f4ng d\u00f9ng file).<\/p>\n<p>Thay v\u00ec b\u1eaft n\u1ea1n nh\u00e2n t\u1ea3i m\u1ed9t file .exe virus v\u1ec1 m\u00e1y, hacker l\u1eeba ng\u01b0\u1eddi d\u00f9ng ch\u1ea1y m\u1ed9t \u0111o\u1ea1n l\u1ec7nh PowerShell \u0111\u1ed9c h\u1ea1i. \u0110o\u1ea1n l\u1ec7nh n\u00e0y s\u1ebd ch\u1ea1y tr\u1ef1c ti\u1ebfp tr\u00ean RAM v\u00e0 kh\u00f4ng \u0111\u1ec3 l\u1ea1i d\u1ea5u v\u1ebft tr\u00ean \u1ed5 c\u1ee9ng, khi\u1ebfn c\u00e1c ph\u1ea7n m\u1ec1m di\u1ec7t virus truy\u1ec1n th\u1ed1ng kh\u00f3 ph\u00e1t hi\u1ec7n.<\/p>\n<p><strong>K\u1ebft lu\u1eadn:<\/strong> S\u1ef1 nguy hi\u1ec3m kh\u00f4ng n\u1eb1m \u1edf c\u00f4ng c\u1ee5, m\u00e0 n\u1eb1m \u1edf c\u00e1ch ng\u01b0\u1eddi d\u00f9ng s\u1eed d\u1ee5ng. N\u1ebfu b\u1ea1n kh\u00f4ng bao gi\u1edd copy-paste c\u00e1c d\u00f2ng l\u1ec7nh l\u1ea1 tr\u00ean m\u1ea1ng v\u00e0o m\u00e1y, PowerShell ho\u00e0n to\u00e0n an to\u00e0n.<\/p>\n<figure id=\"attachment_36420\" aria-describedby=\"caption-attachment-36420\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-36420\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/PowerShell-co-nguy-hiem-khong.jpg\" alt=\"PowerShell c\u00f3 nguy hi\u1ec3m kh\u00f4ng\" width=\"800\" height=\"500\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/PowerShell-co-nguy-hiem-khong.jpg 800w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/PowerShell-co-nguy-hiem-khong-300x188.jpg 300w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/PowerShell-co-nguy-hiem-khong-768x480.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption id=\"caption-attachment-36420\" class=\"wp-caption-text\">PowerShell c\u00f3 nguy hi\u1ec3m kh\u00f4ng?<\/figcaption><\/figure>\n<h3><span class=\"ez-toc-section\" id=\"Co-nen-tat-PowerShell\"><\/span>C\u00f3 n\u00ean t\u1eaft PowerShell?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>InterData khuy\u00ean b\u1ea1n <strong>KH\u00d4NG N\u00caN<\/strong> t\u1eaft ho\u1eb7c x\u00f3a Windows PowerShell.<\/p>\n<ol>\n<li><strong>T\u00edch h\u1ee3p s\u00e2u:<\/strong> PowerShell \u0111\u01b0\u1ee3c t\u00edch h\u1ee3p s\u00e2u v\u00e0o Windows 10 v\u00e0 11. Nhi\u1ec1u t\u00ednh n\u0103ng h\u1ec7 th\u1ed1ng v\u00e0 c\u00e1c c\u00f4ng c\u1ee5 s\u1eeda l\u1ed7i (Troubleshooter) ho\u1ea1t \u0111\u1ed9ng d\u1ef1a tr\u00ean PowerShell. X\u00f3a n\u00f3 c\u00f3 th\u1ec3 g\u00e2y l\u1ed7i Win.<\/li>\n<li><strong>Kh\u00f3 kh\u00f4i ph\u1ee5c:<\/strong> Vi\u1ec7c g\u1ee1 b\u1ecf PowerShell r\u1ea5t ph\u1ee9c t\u1ea1p v\u00e0 \u0111\u00f4i khi y\u00eau c\u1ea7u c\u00e0i l\u1ea1i Win \u0111\u1ec3 kh\u00f4i ph\u1ee5c.<\/li>\n<\/ol>\n<p>Thay v\u00ec t\u1eaft, b\u1ea1n n\u00ean h\u1ecdc c\u00e1ch b\u1ea3o m\u1eadt n\u00f3. Microsoft m\u1eb7c \u0111\u1ecbnh \u0111\u00e3 b\u1eadt ch\u1ebf \u0111\u1ed9 b\u1ea3o v\u1ec7, kh\u00f4ng cho ph\u00e9p ch\u1ea1y c\u00e1c file script l\u1ea1 t\u1ea3i t\u1eeb internet v\u1ec1.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Nhung-ai-thuong-xuyen-su-dung-Windows-PowerShell\"><\/span>Nh\u1eefng ai th\u01b0\u1eddng xuy\u00ean s\u1eed d\u1ee5ng Windows PowerShell?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>D\u1ef1a tr\u00ean nh\u1eefng so s\u00e1nh gi\u1eefa Command Prompt v\u00e0 PowerShell, c\u00f3 th\u1ec3 th\u1ea5y PowerShell l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 m\u1ea1nh m\u1ebd v\u00e0 hi\u1ec7u qu\u1ea3 h\u01a1n r\u1ea5t nhi\u1ec1u. Tuy nhi\u00ean, n\u00f3i r\u1eb1ng PowerShell \u201ct\u1ed1t h\u01a1n ho\u00e0n to\u00e0n\u201d kh\u00f4ng ho\u00e0n to\u00e0n ch\u00ednh x\u00e1c, v\u00ec l\u1ef1a ch\u1ecdn n\u00e0y ph\u1ee5 thu\u1ed9c v\u00e0o nhu c\u1ea7u s\u1eed d\u1ee5ng c\u1ee7a t\u1eebng ng\u01b0\u1eddi.<\/p>\n<p>V\u1edbi ng\u01b0\u1eddi d\u00f9ng Windows ph\u1ed5 th\u00f4ng, PowerShell c\u00f3 th\u1ec3 h\u01a1i ph\u1ee9c t\u1ea1p, trong khi Command Prompt \u0111\u01a1n gi\u1ea3n v\u00e0 d\u1ec5 ti\u1ebfp c\u1eadn h\u01a1n. Ng\u01b0\u1ee3c l\u1ea1i, PowerShell l\u1ea1i mang \u0111\u1ebfn nhi\u1ec1u gi\u00e1 tr\u1ecb h\u01a1n cho nh\u1eefng ng\u01b0\u1eddi c\u1ea7n s\u1ee9c m\u1ea1nh qu\u1ea3n tr\u1ecb h\u1ec7 th\u1ed1ng v\u00e0 kh\u1ea3 n\u0103ng t\u1ef1 \u0111\u1ed9ng h\u00f3a chuy\u00ean s\u00e2u.<\/p>\n<p>Do \u0111\u00f3, PowerShell \u0111\u1eb7c bi\u1ec7t h\u1eefu \u00edch cho qu\u1ea3n tr\u1ecb vi\u00ean h\u1ec7 th\u1ed1ng v\u00e0 chuy\u00ean gia IT, nh\u1eefng ng\u01b0\u1eddi s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 n\u00e0y h\u1eb1ng ng\u00e0y \u0111\u1ec3 h\u1ed7 tr\u1ee3 c\u00f4ng vi\u1ec7c c\u1ee7a h\u1ecd.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Khi-nao-nen-dung-PowerShell-Use-case-thuc-te\"><\/span>Khi n\u00e0o n\u00ean d\u00f9ng PowerShell? (Use-case th\u1ef1c t\u1ebf)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>L\u00fd thuy\u1ebft v\u1ec1 <strong>Windows PowerShell l\u00e0 g\u00ec<\/strong> \u0111\u00e3 c\u00f3, v\u1eady trong th\u1ef1c t\u1ebf c\u00f4ng vi\u1ec7c, khi n\u00e0o ch\u00fang ta th\u1ef1c s\u1ef1 c\u1ea7n &#8220;g\u1ecdi t\u00ean&#8221; n\u00f3? D\u01b0\u1edbi \u0111\u00e2y l\u00e0 c\u00e1c t\u00ecnh hu\u1ed1ng th\u01b0\u1eddng g\u1eb7p t\u1ea1i m\u00f4i tr\u01b0\u1eddng doanh nghi\u1ec7p:<\/p>\n<ol>\n<li><strong>Qu\u1ea3n tr\u1ecb ng\u01b0\u1eddi d\u00f9ng (Active Directory):<\/strong> Khi m\u1ed9t c\u00f4ng ty tuy\u1ec3n d\u1ee5ng 50 nh\u00e2n s\u1ef1 m\u1edbi. Thay v\u00ec t\u1ea1o t\u1eebng t\u00e0i kho\u1ea3n email v\u00e0 ph\u00e2n quy\u1ec1n truy c\u1eadp th\u1ee7 c\u00f4ng m\u1ea5t c\u1ea3 ng\u00e0y, qu\u1ea3n tr\u1ecb vi\u00ean ch\u1ea1y m\u1ed9t script PowerShell. Script n\u00e0y \u0111\u1ecdc danh s\u00e1ch t\u00ean t\u1eeb file Excel v\u00e0 t\u1ef1 \u0111\u1ed9ng t\u1ea1o 50 t\u00e0i kho\u1ea3n trong v\u00f2ng v\u00e0i ph\u00fat.<\/li>\n<li><strong>Backup d\u1eef li\u1ec7u t\u1ef1 \u0111\u1ed9ng:<\/strong> B\u1ea1n c\u00f3 th\u1ec3 vi\u1ebft m\u1ed9t script \u0111\u01a1n gi\u1ea3n \u0111\u1ec3 t\u1ef1 \u0111\u1ed9ng copy to\u00e0n b\u1ed9 d\u1eef li\u1ec7u quan tr\u1ecdng t\u1eeb m\u00e1y ch\u1ee7 sang \u1ed5 c\u1ee9ng d\u1ef1 ph\u00f2ng v\u00e0o \u0111\u00fang 12 gi\u1edd \u0111\u00eam m\u1ed7i ng\u00e0y, sau \u0111\u00f3 t\u1ef1 \u0111\u1ed9ng t\u1eaft m\u00e1y.<\/li>\n<li><strong>Tri\u1ec3n khai ph\u1ea7n m\u1ec1m h\u00e0ng lo\u1ea1t:<\/strong> C\u00e1c nh\u00e2n vi\u00ean IT s\u1eed d\u1ee5ng PowerShell \u0111\u1ec3 c\u00e0i \u0111\u1eb7t b\u1ed9 ph\u1ea7n m\u1ec1m Office, tr\u00ecnh duy\u1ec7t, ph\u1ea7n m\u1ec1m di\u1ec7t virus cho h\u00e0ng lo\u1ea1t m\u00e1y t\u00ednh m\u1edbi mua c\u00f9ng m\u1ed9t l\u00fac th\u00f4ng qua m\u1ea1ng LAN.<\/li>\n<li><strong>DevOps Pipeline:<\/strong> Trong quy tr\u00ecnh ph\u00e1t tri\u1ec3n ph\u1ea7n m\u1ec1m hi\u1ec7n \u0111\u1ea1i (CI\/CD), PowerShell \u0111\u00f3ng vai tr\u00f2 quan tr\u1ecdng trong vi\u1ec7c t\u1ef1 \u0111\u1ed9ng build code, test code v\u00e0 \u0111\u01b0a s\u1ea3n ph\u1ea9m l\u00ean m\u00f4i tr\u01b0\u1eddng production.<\/li>\n<\/ol>\n<article>\n<div>\n<div>\n<h2><span class=\"ez-toc-section\" id=\"Cach-mo-Windows-PowerShell-tren-Windows-10\"><\/span><strong>C\u00e1ch m\u1edf Windows PowerShell tr\u00ean Windows 10<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Trong Windows 10, vi\u1ec7c t\u00ecm v\u00e0 m\u1edf PowerShell r\u1ea5t nhanh ch\u00f3ng th\u00f4ng qua thanh t\u00ecm ki\u1ebfm. B\u1ea1n ch\u1ec9 c\u1ea7n nh\u1eadp <strong>\u201cpowershell\u201d<\/strong> v\u00e0o \u00f4 search tr\u00ean thanh taskbar, sau \u0111\u00f3 nh\u1ea5p ho\u1eb7c ch\u1ea1m v\u00e0o m\u1ee5c <strong>\u201cWindows PowerShell\u201d<\/strong> xu\u1ea5t hi\u1ec7n trong k\u1ebft qu\u1ea3.<\/p>\n<p>N\u1ebfu b\u1ea1n mu\u1ed1n ch\u1ea1y PowerShell v\u1edbi quy\u1ec1n qu\u1ea3n tr\u1ecb, h\u00e3y nh\u1ea5p chu\u1ed9t ph\u1ea3i v\u00e0o bi\u1ec3u t\u01b0\u1ee3ng <strong>\u201cWindows PowerShell\u201d<\/strong> trong danh s\u00e1ch k\u1ebft qu\u1ea3 r\u1ed3i ch\u1ecdn <strong>\u201cRun as administrator\u201d<\/strong>. \u0110\u00e2y l\u00e0 thao t\u00e1c c\u1ea7n thi\u1ebft khi b\u1ea1n mu\u1ed1n th\u1ef1c hi\u1ec7n c\u00e1c l\u1ec7nh y\u00eau c\u1ea7u quy\u1ec1n cao h\u01a1n.<\/p>\n<p>Ngo\u00e0i c\u00e1ch tr\u00ean, Windows v\u1eabn h\u1ed7 tr\u1ee3 nhi\u1ec1u ph\u01b0\u01a1ng ph\u00e1p kh\u00e1c \u0111\u1ec3 m\u1edf c\u1eeda s\u1ed5 PowerShell. Tuy v\u1eady, t\u00ecm ki\u1ebfm tr\u1ef1c ti\u1ebfp tr\u00ean thanh taskbar v\u1eabn l\u00e0 c\u00e1ch \u0111\u01a1n gi\u1ea3n v\u00e0 ti\u1ec7n l\u1ee3i nh\u1ea5t cho ng\u01b0\u1eddi d\u00f9ng khi m\u1edbi b\u1eaft \u0111\u1ea7u.<\/p>\n<\/div>\n<\/div>\n<\/article>\n<h2><span class=\"ez-toc-section\" id=\"Huong-dan-su-dung-PowerShell\"><\/span><strong>H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng PowerShell<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u0110\u1ec3 s\u1eed d\u1ee5ng PowerShell hi\u1ec7u qu\u1ea3, b\u1ea1n c\u00f3 th\u1ec3 l\u00e0m theo hai b\u01b0\u1edbc \u0111\u01a1n gi\u1ea3n sau:<\/p>\n<ul>\n<li><strong>B\u01b0\u1edbc 1:<\/strong> Nh\u1ea5n t\u1ed5 h\u1ee3p ph\u00edm <strong>Windows + R<\/strong>.<\/li>\n<li><strong>B\u01b0\u1edbc 2:<\/strong> Khi c\u1eeda s\u1ed5 Run xu\u1ea5t hi\u1ec7n, nh\u1eadp <strong>PowerShell<\/strong> \u0111\u1ec3 m\u1edf giao di\u1ec7n v\u00e0 b\u1eaft \u0111\u1ea7u thao t\u00e1c.<\/li>\n<\/ul>\n<p>B\u1ea1n n\u00ean n\u1eafm v\u1eefng c\u00e1c l\u1ec7nh PowerShell c\u01a1 b\u1ea3n \u0111\u1ec3 l\u00e0m vi\u1ec7c nhanh ch\u00f3ng v\u00e0 ch\u00ednh x\u00e1c h\u01a1n.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Cach-chay-cmdlet-trong-PowerShell\"><\/span><strong>C\u00e1ch ch\u1ea1y cmdlet trong PowerShell<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Cmdlet l\u00e0 c\u00e1c l\u1ec7nh th\u1ef1c hi\u1ec7n m\u1ed9t ch\u1ee9c n\u0103ng c\u1ee5 th\u1ec3. B\u1ea1n nh\u1eadp ch\u00fang v\u00e0o d\u00f2ng l\u1ec7nh t\u01b0\u01a1ng t\u1ef1 nh\u01b0 khi thao t\u00e1c v\u1edbi l\u1ec7nh truy\u1ec1n th\u1ed1ng. \u0110\u00e2y l\u00e0 c\u00e1ch ch\u00ednh \u0111\u1ec3 t\u01b0\u01a1ng t\u00e1c v\u1edbi giao di\u1ec7n d\u00f2ng l\u1ec7nh PowerShell.<\/p>\n<p>H\u1ea7u h\u1ebft cmdlet \u0111\u01b0\u1ee3c vi\u1ebft b\u1eb1ng <strong>C#<\/strong>, \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf \u0111\u1ec3 tr\u1ea3 v\u1ec1 c\u00e1c \u0111\u1ed1i t\u01b0\u1ee3ng .NET. PowerShell h\u1ed7 tr\u1ee3 h\u01a1n 200 cmdlet, v\u00e0 v\u00ec kh\u00f4ng ph\u00e2n bi\u1ec7t ch\u1eef hoa\/ch\u1eef th\u01b0\u1eddng n\u00ean b\u1ea1n c\u00f3 th\u1ec3 nh\u1eadp b\u1eb1ng b\u1ea5t k\u1ef3 ki\u1ec3u vi\u1ebft n\u00e0o.<\/p>\n<p>M\u1ed9t s\u1ed1 cmdlet ph\u1ed5 bi\u1ebfn g\u1ed3m:<\/p>\n<ul>\n<li>Get-Location \u2013 xem th\u01b0 m\u1ee5c hi\u1ec7n t\u1ea1i<\/li>\n<li>Set-Location \u2013 thay \u0111\u1ed5i th\u01b0 m\u1ee5c<\/li>\n<li>Move-Item \u2013 di chuy\u1ec3n t\u1ec7p<\/li>\n<li>Copy-Item \u2013 sao ch\u00e9p t\u1ec7p<\/li>\n<li>Rename-Item \u2013 \u0111\u1ed5i t\u00ean t\u1ec7p<\/li>\n<li>New-Item \u2013 t\u1ea1o t\u1ec7p m\u1edbi<\/li>\n<\/ul>\n<p>\u0110\u1ec3 xem to\u00e0n b\u1ed9 danh s\u00e1ch cmdlet \u0111ang c\u00f3, nh\u1eadp:<\/p>\n<pre><code>PS C:\\&gt; Get-Command\r\n<\/code><\/pre>\n<p>Theo m\u1eb7c \u0111\u1ecbnh, PowerShell kh\u00f4ng cho ph\u00e9p ch\u1ea1y custom cmdlet v\u00ec ch\u00ednh s\u00e1ch <strong>ExecutionPolicy<\/strong> \u0111ang \u1edf ch\u1ebf \u0111\u1ed9 <strong>Restricted<\/strong>. \u0110\u1ec3 s\u1eed d\u1ee5ng script c\u1ee7a ch\u00ednh b\u1ea1n, h\u00e3y chuy\u1ec3n sang ch\u00ednh s\u00e1ch <strong>RemoteSigned<\/strong>, cho ph\u00e9p ch\u1ea1y script t\u1ef1 t\u1ea1o nh\u01b0ng ch\u1eb7n script ch\u01b0a k\u00fd t\u1eeb ng\u01b0\u1eddi kh\u00e1c.<\/p>\n<p>Thay \u0111\u1ed5i b\u1eb1ng l\u1ec7nh:<\/p>\n<pre><code>PS C:\\&gt; Set-ExecutionPolicy\r\n<\/code><\/pre>\n<p>Ho\u1eb7c \u0111\u1eb7t tr\u1ef1c ti\u1ebfp:<\/p>\n<pre><code>PS C:\\&gt; Set-ExecutionPolicy -ExecutionPolicy RemoteSigned\r\n<\/code><\/pre>\n<p>B\u1ea1n c\u1ea7n d\u00f9ng t\u00e0i kho\u1ea3n Admin \u0111\u1ec3 thay \u0111\u1ed5i c\u00e1c thi\u1ebft l\u1eadp n\u00e0y.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Cach-chay-PowerShell-Script\"><\/span><strong>C\u00e1ch ch\u1ea1y PowerShell Script<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Script trong PowerShell l\u00e0 t\u1ec7p v\u0103n b\u1ea3n c\u00f3 ph\u1ea7n m\u1edf r\u1ed9ng <strong>.ps1<\/strong>. \u0110\u1ec3 t\u1ea1o script m\u1edbi, ch\u1ec9 c\u1ea7n m\u1edf Notepad, nh\u1eadp l\u1ec7nh r\u1ed3i l\u01b0u l\u1ea1i v\u1edbi h\u1eadu t\u1ed1 <code>.ps1<\/code>.<\/p>\n<p>\u0110\u1ec3 ch\u1ea1y script, nh\u1eadp \u0111\u01b0\u1eddng d\u1eabn th\u01b0 m\u1ee5c v\u00e0 t\u00ean t\u1ec7p:<\/p>\n<pre><code>PS C:\\powershell\\mynewscript.ps1\r\n<\/code><\/pre>\n<p>Script s\u1ebd \u0111\u01b0\u1ee3c th\u1ef1c thi ngay sau \u0111\u00f3.<\/p>\n<figure id=\"attachment_36421\" aria-describedby=\"caption-attachment-36421\" style=\"width: 554px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-36421\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/Huong-dan-su-dung-PowerShell.jpg\" alt=\"H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng PowerShell\" width=\"554\" height=\"415\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/Huong-dan-su-dung-PowerShell.jpg 554w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2025\/12\/Huong-dan-su-dung-PowerShell-300x225.jpg 300w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><figcaption id=\"caption-attachment-36421\" class=\"wp-caption-text\">H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng PowerShell<\/figcaption><\/figure>\n<h3><span class=\"ez-toc-section\" id=\"Sao-luu-co-so-du-lieu-SQL-bang-PowerShell\"><\/span><strong>Sao l\u01b0u c\u01a1 s\u1edf d\u1eef li\u1ec7u SQL b\u1eb1ng PowerShell<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Nhi\u1ec1u ng\u01b0\u1eddi d\u00f9ng PowerShell \u0111\u1ec3 sao l\u01b0u SQL Database. B\u1ea1n c\u00f3 th\u1ec3 th\u1ef1c hi\u1ec7n sao l\u01b0u to\u00e0n b\u1ed9 c\u01a1 s\u1edf d\u1eef li\u1ec7u, sao l\u01b0u file ho\u1eb7c transaction log. M\u1ed9t trong nh\u1eefng l\u1ec7nh \u0111\u01a1n gi\u1ea3n nh\u1ea5t l\u00e0:<\/p>\n<pre><code>PS C:\\&gt; Backup-SqlDatabase -ServerInstance \u201cComputer\\Instance\u201d -Database \u201cDatabasecentral\u201d\r\n<\/code><\/pre>\n<p>L\u1ec7nh sao l\u01b0u transaction log:<\/p>\n<pre><code>PS C:\\&gt; Backup-SqlDatabase -ServerInstance \u201cComputer\\Instance\u201d -Database \u201cDatabasecentral\u201d -BackupAction Log\r\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Cac-lenh-PowerShell-co-ban-can-biet\"><\/span><strong>C\u00e1c l\u1ec7nh PowerShell c\u01a1 b\u1ea3n c\u1ea7n bi\u1ebft<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><strong>Get-Help<\/strong><\/h4>\n<p>L\u1ec7nh quan tr\u1ecdng nh\u1ea5t d\u00e0nh cho ng\u01b0\u1eddi m\u1edbi, d\u00f9ng \u0111\u1ec3 xem th\u00f4ng tin v\u00e0 c\u00fa ph\u00e1p c\u1ee7a b\u1ea5t k\u1ef3 l\u1ec7nh n\u00e0o.<\/p>\n<p>V\u00ed d\u1ee5 xem h\u01b0\u1edbng d\u1eabn c\u1ee7a Get-Process:<\/p>\n<pre><code>PS C:\\&gt; Get-Help -Name Get-Process\r\n<\/code><\/pre>\n<p>PowerShell c\u00f3 4 ch\u00ednh s\u00e1ch th\u1ef1c thi script:<\/p>\n<ul>\n<li><strong>Restricted<\/strong> \u2013 m\u1eb7c \u0111\u1ecbnh, kh\u00f4ng cho ch\u1ea1y script<\/li>\n<li><strong>AllSigned<\/strong> \u2013 ch\u1ec9 ch\u1ea1y script \u0111\u00e3 \u0111\u01b0\u1ee3c k\u00fd<\/li>\n<li><strong>RemoteSigned<\/strong> \u2013 ch\u1ea1y script t\u1ea1o tr\u00ean m\u00e1y local<\/li>\n<li><strong>Unrestricted<\/strong> \u2013 kh\u00f4ng gi\u1edbi h\u1ea1n<\/li>\n<\/ul>\n<p>Xem ch\u00ednh s\u00e1ch hi\u1ec7n t\u1ea1i:<\/p>\n<pre><code>PS C:\\&gt; Get-ExecutionPolicy\r\n<\/code><\/pre>\n<p>N\u1ebfu h\u1ec7 th\u1ed1ng \u0111ang \u1edf ch\u1ebf \u0111\u1ed9 Restricted, b\u1ea1n c\u1ea7n chuy\u1ec3n ExecutionPolicy tr\u01b0\u1edbc khi ch\u1ea1y script m\u1edbi.<\/p>\n<h4><strong>Get-Service<\/strong><\/h4>\n<p>L\u1ec7nh n\u00e0y hi\u1ec3n th\u1ecb t\u1ea5t c\u1ea3 d\u1ecbch v\u1ee5 tr\u00ean m\u00e1y, bao g\u1ed3m tr\u1ea1ng th\u00e1i v\u00e0 t\u00ean.<\/p>\n<pre><code>PS C:\\&gt; Get-Service\r\n<\/code><\/pre>\n<p>L\u1ecdc d\u1ecbch v\u1ee5 b\u1eaft \u0111\u1ea7u b\u1eb1ng WMI:<\/p>\n<pre><code>PS C:\\&gt; Get-Service \"WMI*\"\r\n<\/code><\/pre>\n<p>L\u1ecdc c\u00e1c d\u1ecbch v\u1ee5 \u0111ang ch\u1ea1y:<\/p>\n<pre><code>PS C:\\&gt; Get-Service | Where-Object {$_.Status -eq \"Running\"}\r\n<\/code><\/pre>\n<h4><strong>ConvertTo-Html<\/strong><\/h4>\n<p>L\u1ec7nh n\u00e0y h\u1ed7 tr\u1ee3 t\u1ea1o b\u00e1o c\u00e1o HTML t\u1eeb d\u1eef li\u1ec7u PowerShell.<\/p>\n<p>V\u00ed d\u1ee5:<\/p>\n<pre><code>Get-PSDrive | ConvertTo-Html\r\n<\/code><\/pre>\n<p>Ghi ra t\u1ec7p:<\/p>\n<pre><code>Get-PSDrive | ConvertTo-Html | Out-File -FilePath PSDrives.html\r\n<\/code><\/pre>\n<h4><strong>Export-CSV (k\u00e8m Get-Service)<\/strong><\/h4>\n<p>L\u1ec7nh Export-CSV gi\u00fap xu\u1ea5t d\u1eef li\u1ec7u PowerShell sang t\u1ec7p CSV \u0111\u1ec3 chia s\u1ebb ho\u1eb7c d\u00f9ng trong b\u1ea3ng t\u00ednh.<\/p>\n<p>V\u00ed d\u1ee5:<\/p>\n<pre><code>PS C:\\&gt; Get-Service | Export-CSV c:\\service.csv\r\n<\/code><\/pre>\n<p>Xu\u1ea5t ch\u1ec9 t\u00ean v\u00e0 tr\u1ea1ng th\u00e1i d\u1ecbch v\u1ee5:<\/p>\n<pre><code>PS C:\\&gt; Get-Service | Select-Object Name, Status | Export-CSV c:\\Service.csv\r\n<\/code><\/pre>\n<h4><strong>Get-Process<\/strong><\/h4>\n<p>Xem danh s\u00e1ch to\u00e0n b\u1ed9 ti\u1ebfn tr\u00ecnh \u0111ang ch\u1ea1y:<\/p>\n<pre><code>PS C:\\&gt; Get-Process\r\n<\/code><\/pre>\n<p>Xem chi ti\u1ebft ti\u1ebfn tr\u00ecnh c\u1ee5 th\u1ec3:<\/p>\n<pre><code>PS C:\\&gt; Get-Process winword, explorer | Format-List *\r\n<\/code><\/pre>\n<h4><strong>Get-EventLog<\/strong><\/h4>\n<p>D\u00f9ng \u0111\u1ec3 xem nh\u1eadt k\u00fd s\u1ef1 ki\u1ec7n c\u1ee7a m\u00e1y ho\u1eb7c t\u1eeb m\u00e1y kh\u00e1c.<\/p>\n<p>Xem to\u00e0n b\u1ed9 event log:<\/p>\n<pre><code>PS C:\\&gt; Get-EventLog -List\r\n<\/code><\/pre>\n<p>Xem l\u1ed7i trong System log:<\/p>\n<pre><code>PS C:\\&gt; Get-EventLog -LogName System -EntryType Error\r\n<\/code><\/pre>\n<p>L\u1ea5y log t\u1eeb nhi\u1ec1u m\u00e1y:<\/p>\n<pre><code>PS C:\\&gt; Get-EventLog -LogName \"Windows PowerShell\" -ComputerName \"local computer\", \"Server1\", \"Server2\"\r\n<\/code><\/pre>\n<p>PowerShell h\u1ed7 tr\u1ee3 nhi\u1ec1u tham s\u1ed1 \u0111\u1ec3 l\u1ecdc log nh\u01b0 After, Before, EntryType, Index, UserName\u2026<\/p>\n<h4><strong>Stop-Process<\/strong><\/h4>\n<p>D\u1eebng m\u1ed9t ti\u1ebfn tr\u00ecnh \u0111ang treo ho\u1eb7c ho\u1ea1t \u0111\u1ed9ng kh\u00f4ng \u1ed5n \u0111\u1ecbnh.<\/p>\n<p>V\u00ed d\u1ee5 d\u1eebng Notepad:<\/p>\n<pre><code>PS C:\\&gt; Stop-Process -Name \"notepad\"<\/code><\/pre>\n<p>Qua b\u00e0i vi\u1ebft n\u00e0y, <strong><a href=\"https:\/\/interdata.vn\/\">InterData<\/a> <\/strong>hy v\u1ecdng b\u1ea1n \u0111\u00e3 c\u00f3 c\u00e1i nh\u00ecn to\u00e0n di\u1ec7n v\u1ec1\u00a0Windows PowerShell l\u00e0 g\u00ec. Kh\u00f4ng ch\u1ec9 \u0111\u01a1n thu\u1ea7n l\u00e0 m\u1ed9t m\u00e0n h\u00ecnh d\u00f2ng l\u1ec7nh m\u00e0u xanh, PowerShell l\u00e0 tr\u1ee3 th\u1ee7 \u0111\u1eafc l\u1ef1c gi\u00fap b\u1ea1n giao ti\u1ebfp v\u00e0 ra l\u1ec7nh cho m\u00e1y t\u00ednh m\u1ed9t c\u00e1ch chuy\u00ean nghi\u1ec7p.<\/p>\n<p>Cho d\u00f9 b\u1ea1n l\u00e0 m\u1ed9t ng\u01b0\u1eddi d\u00f9ng ph\u1ed5 th\u00f4ng mu\u1ed1n t\u00ecm hi\u1ec3u v\u1ec1 m\u00e1y t\u00ednh, hay m\u1ed9t sinh vi\u00ean CNTT \u0111ang tr\u00ean \u0111\u01b0\u1eddng tr\u1edf th\u00e0nh qu\u1ea3n tr\u1ecb vi\u00ean h\u1ec7 th\u1ed1ng, vi\u1ec7c n\u1eafm v\u1eefng c\u00e1c ki\u1ebfn th\u1ee9c v\u00e0 l\u1ec7nh c\u01a1 b\u1ea3n c\u1ee7a PowerShell s\u1ebd l\u00e0 m\u1ed9t l\u1ee3i th\u1ebf l\u1edbn. \u0110\u1eebng ng\u1ea7n ng\u1ea1i m\u1edf c\u1eeda s\u1ed5 Console l\u00ean v\u00e0 th\u1eed ch\u1ea1y l\u1ec7nh\u00a0Get-Service\u00a0ngay b\u00e2y gi\u1edd \u0111\u1ec3 tr\u1ea3i nghi\u1ec7m s\u1ef1 kh\u00e1c bi\u1ec7t.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>N\u1ebfu b\u1ea1n \u0111ang t\u00ecm c\u00e1ch qu\u1ea3n tr\u1ecb Windows hi\u1ec7u qu\u1ea3 h\u01a1n, t\u1ef1 \u0111\u1ed9ng h\u00f3a c\u00e1c t\u00e1c v\u1ee5 l\u1eb7p l\u1ea1i, hay \u0111\u01a1n gi\u1ea3n ch\u1ec9 mu\u1ed1n hi\u1ec3u v\u00ec sao nhi\u1ec1u h\u01b0\u1edbng d\u1eabn k\u1ef9 thu\u1eadt y\u00eau c\u1ea7u \u201cm\u1edf PowerShell\u201d, th\u00ec ch\u1eafc ch\u1eafn s\u1ebd t\u00ecm hi\u1ec3u qua Windows PowerShell. V\u1eady Windows PowerShell l\u00e0 g\u00ec? B\u00e0i vi\u1ebft d\u01b0\u1edbi \u0111\u00e2y s\u1ebd<\/p>\n","protected":false},"author":11,"featured_media":36424,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[84],"tags":[],"class_list":["post-36405","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cong-cu-phan-mem"],"_links":{"self":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts\/36405","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/comments?post=36405"}],"version-history":[{"count":1,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts\/36405\/revisions"}],"predecessor-version":[{"id":36425,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts\/36405\/revisions\/36425"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/media\/36424"}],"wp:attachment":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/media?parent=36405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/categories?post=36405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/tags?post=36405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}