15 Useful PowerShell Commands for Beginners | Learn Microsoft PowerShell

preview_player
Показать описание
Microsoft created the PowerShell for task automation and configuration management. If you want to learn the PowerShell and looking for some useful commands to start with, then watch this video till the end and you learn such 15 useful PowerShell commands for newbies.

Follow the timestamp to quickly jump to the command you want to learn--

1. Listing the drives 0:34
Get-PSDrive
To list drives with the file system
Get-PSDrive –PSProvider FileSystem

2. Listing the files in a directory 1:10
Get-ChildItem
To list files in another directory
Get-ChildItem path-of-another-directory

3. Changing the current directory 1:36
Set-Location path

4. Creating a new item 1:53
To create directory
New-Item –ItemType Directory –Path path -Name name-of-the-directory
To create file
New-Item –ItemType File –Path path –Name filename –Value “value in your file”
To edit content later
Set-Content –Path path-of-file –Value “your new value”

5. Viewing file information or printing it 3:10
To view file information
Get-Item file-name
To view the content of the file
Get-Content file-name
To view it in an external window
Get-Content file-name | Out-GridView
To print it
Get-Content file-name | Out-Printer

6. Renaming a file or folder 4:03
Rename-Item –Path path –NewName new-name

7. Copying or moving an item 4:34
To copy
Copy-Item path-with-file-name –Destination destination-path
To move
Move-Item –Path path-with-file-name –Destination destination-path
To move and rename
Move-Item –Path path-with-file-name –Destination destination-path-with-new-name

8. Removing a file or directory 5:44
Remove-Item file-or-directory-name

9. Getting all the commands 6:00
Get-Command
To get command of specific type
Get-Command –CommandType function, alias, or cmdlet
To search for a command
Get-Command *search-value

10. Getting help for a command 6:32
Get-Help command-name
To get examples
Get-Help command-name -Example

11. Getting the list of processes and services 7:04
For processes
Get-Process
For services
Get-Service

12. To stop a process 7:20
Stop-Process –Name name-of-process
To stop a particular instance of the process and confirm
Stop-Process –Id id-of-process –Confirm -PassThru

13. Get the list of Windows drivers 8:01
Get-WindowsDriver –Online –All

14. Taking backup of drivers 8:15
Export-WindowsDriver -Online -Destination path-for-backup

15. Scan for malware 8:42
Start-MpScan –ScanType QuickScan/FullScan –ScanPath directory-path-to-be-scanned

We will be uploading a video on advanced PowerShell commands so subscribe to the channel and press the bell button to get the notification.
Рекомендации по теме
Комментарии
Автор

Thanks! Brilliant and simple, exactly what i needed.

Sexyoldgeraldorivera
Автор

You can toggle to turn on Defender in the Virus & Threat protection tab in settings to run concurrently. I re-ran the start-mpscan and it worked just fine.

thelastagain
Автор

Great video, I'm new to powershell but found this really helpful. Thanks :)

aaronunroe
Автор

This looks promising, I might subscribe. I have an automation project in mind that PS might be the answer.

davegoodo
Автор

very good introduction ..nice and easy to learn thanks

wisamkhalid
Автор

Thank you for speaking English correctly. So refreshing!

bingbird
Автор

Very good content, apprecaited. Set-Location c:\Test2

antoniolelo
Автор

Hi, one question, I have a folder named ''30 - Miscellaneous'', how can I use the Get-ChildItem command when my folder includes the "-" symbol?

gabrielangellerma
Автор

I thought powershell was supposed to be easier to use >_< Thank you for the information :D

lynderavickland
Автор

this is used for "for task automation and configuration management". can you give practical examples of such uses?

terrybuchanan
Автор

Thanks for the video. For such simple tasks, PS solutions seem quite verbose. I have used linux-like utilities, ported to Windows for years for such tasks. I suspect that this approach for PS is needed for the more complicated tasks that it is capable of.

corkerydan
Автор

Thanks i really did want to mess with the PowerShell

Shaelyncrowe
Автор

Yeah but what most people think of when they think of these commands is: "But I can just create the file without using Powershell. What good does those commands do?" People are more into commands they wouldn't ordinarily do on their comnputer, things that can make things easier for them or automation etc.

asonofgod
Автор

how can I get a list of running apps under categories of Apps in TaskManger

sreenivasdatta
Автор

where is the link to advanced PowerShell commands? searched for it but did not find it?

wisamkhalid
Автор

what is the command for restricting modifications

kakitapallisaisantosh
Автор

IO meter application need to run automation after Power On the motherboard. Can you please post the code.

pravinsengottaiyan
Автор

Hi, When I type net session in Powershell, it shows me an SMB connections. Is there a way I can show SSH connection from PowerShell?

ryan
Автор

Hi Ma'am! Hope all is good. Just wanted to ask how do you quickly go to a child directory without typing all the parent directories with the absolute path method. I believe before you can use the Drive:/~ / target using the ~symbol as a wildcard if I'm not wrong. Because I have a working folder which is on a folder structure with too many parents and I want to change directories quickly without having to type all of the parents above. Below is my folder structure. I would know if a shortcut is possible in Powershell without having to type all parents. Something like this F:/~ /24NODE JS but this is not working
F:\TO STUDY\WEB DEVELOPER\WEB DEVELOPER BOOTCAMP\AON_WEB DEVELOPER BOOTCAMP Colt\24 NODE JS

mataal
Автор

so used to linux, this is garbage lol

oglala_lakotao