Site icon MiltonMarketing.com – Bernard Aybout's Blog

Basic PowerShell commands that every Windows 10 user should know

Basic PowerShell commands that every Windows 10 user should know

Basic PowerShell commands that every Windows 10 user should know

PowerShell is a powerful scripting language and command-line shell that is built into Windows. It’s designed for system administration, automation, and configuration management. For Windows 10 users, especially those with an interest in managing their system more efficiently or automating tasks, knowing a few basic PowerShell commands can be very helpful. Here are some essential PowerShell commands that every Windows 10 user should be familiar with:

  1. Get-Help: Before diving into other commands, it’s crucial to know how to get help. The Get-Help command can be used to find information about PowerShell commands and syntax. For example, Get-Help Get-Process would provide details on how the Get-Process command works.
  2. Get-Command: To discover the commands available in PowerShell, you can use the Get-Command command. This is particularly useful for beginners to explore what commands are at their disposal.
  3. Get-Process: This command allows you to view all the running processes on your system. It’s similar to the Task Manager in Windows but gives you a way to monitor these processes through the command line.
  4. Start-Process and Stop-Process: These commands allow you to start and stop processes, respectively. For instance, Start-Process notepad would open Notepad, and Stop-Process -Name notepad would close it.
  5. Set-ExecutionPolicy: By default, PowerShell restricts the execution of scripts for security reasons. To run scripts, you might need to change the execution policy using the Set-ExecutionPolicy command, for example, Set-ExecutionPolicy RemoteSigned.
  6. Get-Service: This command displays all the services installed on the system, showing their status as Running, Stopped, or Paused. You can also start, stop, or pause services with the Start-Service, Stop-Service, and Suspend-Service commands.
  7. Get-Item: Allows you to get the item at a specific location. This command is not restricted to files and folders but can also work with registry keys, environmental variables, etc.
  8. Copy-Item, Remove-Item, Rename-Item: These commands allow you to manipulate files and directories—copying, removing, and renaming them, respectively.
  9. Get-Content and Set-Content: To read and write content to a file, you can use Get-Content and Set-Content. For example, Get-Content log.txt would display the content of log.txt, and Set-Content log.txt -Value "New content" would overwrite log.txt with “New content”.
  10. Select-String: This command is used for searching within files for specific patterns, similar to grep in Linux/UNIX.
  11. Get-EventLog: Useful for viewing Windows event logs from the command line. For example, Get-EventLog -LogName Application would show entries from the Application log.
  12. Update-Help: PowerShell’s help system is not fully downloaded by default. Running Update-Help downloads the latest help files for PowerShell commands, ensuring that Get-Help provides you with the most up-to-date information.

These commands only scratch the surface of what PowerShell can do, but they are a good starting point for anyone looking to become more proficient in managing and automating tasks in Windows 10. Remember, the Get-Help command is your best friend when learning PowerShell; use it often to explore and understand the capabilities of different commands.


For those ready to delve deeper into PowerShell’s capabilities, here are 10 more advanced commands that can significantly enhance your scripting and system management skills:

  1. Invoke-Command: This command is used to run scripts or commands on remote computers. It’s extremely powerful for managing multiple machines at once. For example, Invoke-Command -ComputerName Server01, Server02 -ScriptBlock {Get-Service} runs Get-Service on Server01 and Server02.
  2. ConvertTo-Json and ConvertFrom-Json: These commands are invaluable when working with JSON data. You can convert PowerShell objects to JSON format and vice versa, facilitating integration with web APIs and other data sources that use JSON.
  3. Export-Csv and Import-Csv: These commands allow you to export objects to a CSV file and import objects from a CSV file, respectively. This is particularly useful for data manipulation and reporting tasks.
  4. Select-Object: This command is used for selecting specific properties of objects or for creating new custom objects. It’s handy for filtering data or simplifying output.
  5. Where-Object: Allows you to filter objects based on their properties. It’s the PowerShell equivalent of applying a “where” clause in SQL or a filter in Excel.
  6. ForEach-Object: This command iterates over each item in a collection of objects, allowing you to perform operations on each object. It’s similar to a “for each” loop in programming languages.
  7. New-Object: With this command, you can create instances of .NET objects. This can be useful for utilizing .NET libraries and capabilities within your PowerShell scripts.
  8. Get-WmiObject/Get-CimInstance: These commands are used to access Windows Management Instrumentation (WMI) and Common Information Model (CIM) data. This data provides a wealth of information and control over hardware, operating systems, and installed applications. Get-CimInstance is the newer cmdlet that uses the WS-Management protocol, which is more secure and efficient than the DCOM protocol used by Get-WmiObject.
  9. Test-Path: This command checks the existence of a file, folder, or registry key, returning True or False. It’s very useful for conditional statements in scripts to verify if a particular item exists before proceeding.
  10. New-PSDrive: This command creates temporary and persistent mapped network drives. Beyond network drives, it can also be used to create drives that are mapped to other data stores, like the registry or a certificate store, providing a unified interface to access different types of data.

These advanced commands offer a glimpse into the power and flexibility of PowerShell for automating complex tasks, managing systems, and manipulating data. Remember, the versatility of PowerShell lies in its ability to integrate with a wide range of technologies and data types, making it an invaluable tool for administrators, developers, and IT professionals.


Basic PowerShell commands that every Windows 10 user should know: Windows PowerShell is powerful and can do almost everything that a person wants on his computer. But the only problem is that it is a command line tool and does not have GUI. However, it can be helpful when the GUI based interface fails or stops responding. The main thing unfortunately is the fact that a normal user lacks the knowledge of using PowerShell to its full potential. But today, we will be trying to discuss the top 10 PowerShell commands that can help a user do more on Windows 10.

Basic PowerShell commands that every Windows 10 user should know

Before we begin, we must highlighted that some of these cmdlets might toggle certain settings or configuration on your computer.

cmdlet is a PowerShell script that performs a single function. So, to be on the safer side, create a System Restore point first.

If something goes wrong during trying one of the following cmdlets, you can always restore your computer.

We will be taking a look at cmdlets that can do the following:

Basic PowerShell commands that every Windows 10 user should know

1] Launch a UWP Application

cmdlets are great tools which can be used to launch UWP Applications within seconds. But the main thing lies in the proper execution of a command. You can use:

Start-Process "ms-settings:"

This command launches the Windows Settings UWP Application. You can learn more about other URIs for other UWP Applications here on microsoft.com.

Videos on how to launch a UWP Application in a cmdlet Windows 10 PowerShell

Basic PowerShell commands that every Windows 10 user should know

2] Get Help regarding any cmdlet

If you are ever stuck confused about what command you must be used to execute a specific task. Or what a specific cmdlet does, you do not need worry. You can just use the Get-Help cmdlet to do it. You can use it in the following ways:

Get-Help

Get-Help <command name>

Get-Help <command name> -Full

Get-Help <command name> -Example

Get-Help *

Here, the first entry will guide you on how to use this cmdlet. The second entry will give you a simple summary of the particular cmdlet. The third entry will give detailed information about the respective cmdlet. The fourth entry will comprise of everything that the third cmdlet shows but will add an example of how to use that cmdlet. And finally, the fifth cmdlet will list every command that is available for your use.

Videos on how to get help regarding any cmdlet.

Basic PowerShell commands that every Windows 10 user should know

3] Get Similar Commands

To find commands of a similar type or that contain a particular phrase in them, you can use the Get-Command cmdlet. However, it does not list out every cmdlet in PowerShell, so you make use of some particular filters. You can use the following commands:

Get-Command -Name <name>

Get-Command -CommandType <type>

The first cmdlet will help you in finding a cmdlet with a particular phrase in it whereas the second one will enable you to filter out cmdlets that perform a particular function.

Videos on how to Get Similar commands in Windows 10 PowerShell

Basic PowerShell commands that every Windows 10 user should know

4] Finding a particular file

If you need to find a particular file or a directory in a particular location, you can use the Get-Item cmdlet. You can use it as follows:

Get-Item <PATH>

This lists out the contents of the particular path.

Videos on how to find a particular file in Windows 10 PowerShell

Basic PowerShell commands that every Windows 10 user should know

5] Read the contents of a file

If you need to read the contents of a file, you can use the Get-Content command as follows:

Get-Content <PATH of the file with its extension>

This particular example above is the Windows Hosts file. Notice we use $env:SystemRoot in place of C: (drive) and C:\WINDOWS (windows folder). The reason for this is because the drive/network letter and windows installation folder are all user dependant, therefor the system environment variable holds this information.

Videos on how to read the contents of a file in Windows 10 PowerShell

Basic PowerShell commands that every Windows 10 user should know

6] Read information about all the services on a computer

You can use the Get-Service cmdlet to list all the services running or stopped on your computer. Alternatively, you can use the following related cmdlets to do their respective functions:

Start-Service <Service Name>

Stop-Service <Service Name>

Suspend-Service <Service Name>

Resume-Service <Service Name>

Restart-Service <Service Name>
Videos on how to read information about all the services on a computer in Windows 10 PowerShell.

Basic PowerShell commands that every Windows 10 user should know

7] Read information about all the processes on a computer

Similar to the Get-Service cmdlet, you can use the Get-Process cmdlet to list all the Processes running on your computer. Alternatively, you can use the following related cmdlets to do their respective functions:

Start-Process <Process Name>

Stop-Process <Process Name>

Wait-Service <Process Name>
Videos on how to read information about all the processes on a computer in Windows 10 PowerShell

Basic PowerShell commands that every Windows 10 user should know

8] Setting the Execution Policy

While there is support for creating and executing scripts on PowerShell, there are restrictions to each one of them as a part of some security measures. You can toggle the Security level to any of the 4 levels. You can use the Set-ExecutionPolicy cmdlet followed by any of the security levels given as follows:

Set-ExecutionPolicy Unrestricted

Set-ExecutionPolicy All Signed

Set-ExecutionPolicy Remote Signed

Set-ExecutionPolicy Restricted

Here, the policies from top to bottom range from lowest to the highest level of security.

Videos on Setting the Execution Policy in Windows 10 PowerShell

Basic PowerShell commands that every Windows 10 user should know

9] Copy a file or a directory

A user can make use of the Copy-Item cmdlet to copy one file or directory to another destination. The syntax for this cmdlet is below:

Copy-Item "E:\Test.txt" -Destination "D:\"

Videos of how to Copy a file or a directory in Windows 10 PowerShell

Basic PowerShell commands that every Windows 10 user should know

10] Delete a file or a directory

Similar to the Copy-Item cmdlet, A user can make use of the Copy-Item cmdlet to copy one file or directory to another destination. The syntax for this cmdlet is as follows:

Remove-Item "E:\Test.txt"
Videos on how to Delete a file or a directory
  1. Get-Help: Before diving into other commands, it’s crucial to know how to get help. The Get-Help command can be used to find information about PowerShell commands and syntax. For example, Get-Help Get-Process would provide details on how the Get-Process command works.
  2. Get-Command: To discover the commands available in PowerShell, you can use the Get-Command command. This is particularly useful for beginners to explore what commands are at their disposal.
  3. Get-Process: This command allows you to view all the running processes on your system. It’s similar to the Task Manager in Windows but gives you a way to monitor these processes through the command line.
  4. Start-Process and Stop-Process: These commands allow you to start and stop processes, respectively. For instance, Start-Process notepad would open Notepad, and Stop-Process -Name notepad would close it.
  5. Set-ExecutionPolicy: By default, PowerShell restricts the execution of scripts for security reasons. To run scripts, you might need to change the execution policy using the Set-ExecutionPolicy command, for example, Set-ExecutionPolicy RemoteSigned.
  6. Get-Service: This command displays all the services installed on the system, showing their status as Running, Stopped, or Paused. You can also start, stop, or pause services with the Start-Service, Stop-Service, and Suspend-Service commands.
  7. Get-Item: Allows you to get the item at a specific location. This command is not restricted to files and folders but can also work with registry keys, environmental variables, etc.
  8. Copy-Item, Remove-Item, Rename-Item: These commands allow you to manipulate files and directories—copying, removing, and renaming them, respectively.
  9. Get-Content and Set-Content: To read and write content to a file, you can use Get-Content and Set-Content. For example, Get-Content log.txt would display the content of log.txt, and Set-Content log.txt -Value "New content" would overwrite log.txt with “New content”.
  10. Select-String: This command is used for searching within files for specific patterns, similar to grep in Linux/UNIX.
  11. Get-EventLog: Useful for viewing Windows event logs from the command line. For example, Get-EventLog -LogName Application would show entries from the Application log.
  12. Update-Help: PowerShell’s help system is not fully downloaded by default. Running Update-Help downloads the latest help files for PowerShell commands, ensuring that Get-Help provides you with the most up-to-date information.
  13. Invoke-Command: This command is used to run scripts or commands on remote computers. It’s extremely powerful for managing multiple machines at once. For example, Invoke-Command -ComputerName Server01, Server02 -ScriptBlock {Get-Service} runs Get-Service on Server01 and Server02.
  14. ConvertTo-Json and ConvertFrom-Json: These commands are invaluable when working with JSON data. You can convert PowerShell objects to JSON format and vice versa, facilitating integration with web APIs and other data sources that use JSON.
  15. Export-Csv and Import-Csv: These commands allow you to export objects to a CSV file and import objects from a CSV file, respectively. This is particularly useful for data manipulation and reporting tasks.
  16. Select-Object: This command is used for selecting specific properties of objects or for creating new custom objects. It’s handy for filtering data or simplifying output.
  17. Where-Object: Allows you to filter objects based on their properties. It’s the PowerShell equivalent of applying a “where” clause in SQL or a filter in Excel.
  18. ForEach-Object: This command iterates over each item in a collection of objects, allowing you to perform operations on each object. It’s similar to a “for each” loop in programming languages.
  19. New-Object: With this command, you can create instances of .NET objects. This can be useful for utilizing .NET libraries and capabilities within your PowerShell scripts.
  20. Get-WmiObject/Get-CimInstance: These commands are used to access Windows Management Instrumentation (WMI) and Common Information Model (CIM) data. This data provides a wealth of information and control over hardware, operating systems, and installed applications. Get-CimInstance is the newer cmdlet that uses the WS-Management protocol, which is more secure and efficient than the DCOM protocol used by Get-WmiObject.
  21. Test-Path: This command checks the existence of a file, folder, or registry key, returning True or False. It’s very useful for conditional statements in scripts to verify if a particular item exists before proceeding.
  22. New-PSDrive: This command creates temporary and persistent mapped network drives. Beyond network drives, it can also be used to create drives that are mapped to other data stores, like the registry or a certificate store, providing a unified interface to access different types of data.
  23. Get-Help
    • Use: Retrieves documentation about PowerShell commands.
    • Example: Get-Help Get-Process
  24. Get-Command
    • Use: Lists all commands available in PowerShell.
    • Example: Get-Command -Noun Process
  25. Get-Process
    • Use: Gets the processes running on the computer.
    • Example: Get-Process -Name notepad
  26. Start-Process
    • Use: Starts one or more processes on the local computer.
    • Example: Start-Process notepad.exe
  27. Stop-Process
    • Use: Stops one or more running processes.
    • Example: Stop-Process -Name notepad
  28. Set-ExecutionPolicy
    • Use: Changes the user preference for PowerShell script execution.
    • Example: Set-ExecutionPolicy RemoteSigned
  29. Get-Service
    • Use: Retrieves the status of services.
    • Example: Get-Service -Name wuauserv
  30. Start-Service
    • Use: Starts one or more stopped services.
    • Example: Start-Service -Name wuauserv
  31. Stop-Service
    • Use: Stops one or more running services.
    • Example: Stop-Service -Name wuauserv
  32. Get-Item
    • Use: Gets the item at the specified location.
    • Example: Get-Item C:\Windows\notepad.exe
  33. Copy-Item
    • Use: Copies an item from one location to another.
    • Example: Copy-Item C:\file.txt -Destination C:\backup\file.txt
  34. Remove-Item
    • Use: Deletes one or more items.
    • Example: Remove-Item C:\file.txt
  35. Rename-Item
    • Use: Renames an item.
    • Example: Rename-Item C:\file.txt -NewName file2.txt
  36. Get-Content
    • Use: Gets the content of the item at the specified location.
    • Example: Get-Content C:\log.txt
  37. Set-Content
    • Use: Writes or replaces the content in an item with new content.
    • Example: Set-Content C:\log.txt -Value "New log entry"
  38. Add-Content
    • Use: Appends content to a specified item.
    • Example: Add-Content C:\log.txt -Value "Appended log entry"
  39. Clear-Content
    • Use: Clears the content of an item without deleting the item.
    • Example: Clear-Content C:\log.txt
  40. Import-Csv
    • Use: Imports a CSV file to a PowerShell object.
    • Example: Import-Csv -Path C:\data.csv
  41. Export-Csv
    • Use: Exports PowerShell objects to a CSV file.
    • Example: Get-Process | Export-Csv -Path C:\processes.csv
  42. ConvertTo-Html
    • Use: Converts .NET objects into HTML.
    • Example: Get-Process | ConvertTo-Html -Title "Process List" > processes.html
  43. Out-File
    • Use: Sends output to a file.
    • Example: Get-Process > C:\processes.txt
  44. Select-String
    • Use: Searches for text in strings and files.
    • Example: Select-String -Path C:\logs\*.log -Pattern "error"
  45. Invoke-WebRequest
    • Use: Makes an HTTP or HTTPS request to a web page.
    • Example: Invoke-WebRequest -Uri "http://example.com"
  46. Invoke-RestMethod
    • Use: Sends an HTTP or HTTPS request to a RESTful web service.
    • Example: Invoke-RestMethod -Uri "http://example.com/api/values" -Method Get
  47. New-Item
    • Use: Creates a new item.
    • Example: New-Item -Path 'C:\new_folder' -ItemType Directory
  48. Get-EventLog
    • Use: Retrieves entries from event logs.
    • Example: Get-EventLog -LogName Application -Newest 50
  49. New-Service
    • Use: Creates a new service.
    • Example: New-Service -Name "MyService" -BinaryPathName "C:\path\to\service.exe" -DisplayName "My Custom Service"
  50. Get-ACL
    • Use: Gets the Access Control List (ACL) entries for a specified resource.
    • Example: Get-ACL C:\path\to\file.txt
  51. Set-ACL
    • Use: Sets the ACL for a resource.
    • Example: $acl = Get-ACL C:\path\to\file.txt; Set-ACL -Path C:\path\to\file.txt -AclObject $acl
  52. Get-LocalUser
    • Use: Retrieves local user accounts.
    • Example: Get-LocalUser
  53. New-LocalUser
    • Use: Creates a new local user account.
    • Example: New-LocalUser -Name "NewUser" -Password (ConvertTo-SecureString -AsPlainText "P@ssword!" -Force)
  54. Remove-LocalUser
    • Use: Deletes a local user account.
    • Example: Remove-LocalUser -Name "OldUser"
  55. Get-LocalGroup
    • Use: Retrieves local groups.
    • Example: Get-LocalGroup
  56. Add-LocalGroupMember
    • Use: Adds a user to a local group.
    • Example: Add-LocalGroupMember -Group "Administrators" -Member "NewUser"
  57. Remove-LocalGroupMember
    • Use: Removes a user from a local group.
    • Example: Remove-LocalGroupMember -Group "Administrators" -Member "OldUser"
  58. Get-PSSession
    • Use: Gets information about PowerShell sessions (PSSessions).
    • Example: Get-PSSession
  59. New-PSSession
    • Use: Creates a new PowerShell session.
    • Example: New-PSSession -ComputerName Server01
  60. Enter-PSSession
    • Use: Starts an interactive session with a remote computer.
    • Example: Enter-PSSession -ComputerName Server01
  61. Exit-PSSession
    • Use: Ends an interactive session with a remote computer.
    • Example: Exit-PSSession
  62. Invoke-Expression
    • Use: Executes a string as a PowerShell expression.
    • Example: Invoke-Expression -Command "Get-Date"
  63. Get-Host
    • Use: Retrieves information about the PowerShell host.
    • Example: Get-Host
  64. Get-History
    • Use: Retrieves a list of the commands entered during the current session.
    • Example: Get-History
  65. Invoke-History
    • Use: Runs commands from the session history.
    • Example: Invoke-History -Id 10
  66. Get-Job
    • Use: Gets PowerShell background jobs that are running in the current session.
    • Example: Get-Job
  67. Start-Job
    • Use: Starts a PowerShell background job.
    • Example: Start-Job -ScriptBlock {Get-Process}
  68. Stop-Job
    • Use: Stops a PowerShell background job.
    • Example: Stop-Job -Id 1
  69. Receive-Job
    • Use: Gets the results of one or more PowerShell background jobs.
    • Example: Receive-Job -Id 1
  70. Remove-Job
    • Use: Deletes a PowerShell background job.
    • Example: Remove-Job -Id 1
  71. Get-PSDrive
    • Use: Retrieves information about PowerShell drives.
    • Example: Get-PSDrive
  72. New-PSDrive
    • Use: Creates a new PowerShell drive.
    • Example: New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\Server\SharedFolder"
  73. Test-Connection
    • Use: Sends ICMP echo request packets (“pings”) to a target host and returns the results.
    • Example: Test-Connection google.com
  74. Compress-Archive
    • Use: Creates a compressed archive file (zip file) from specified files and folders.
    • Example: Compress-Archive -Path C:\Data -DestinationPath C:\Data.zip
  75. Expand-Archive
    • Use: Extracts files from a compressed archive (zip file).
    • Example: Expand-Archive -Path C:\Data.zip -DestinationPath C:\Data
  76. Get-Date
    • Use: Gets the current date and time.
    • Example: Get-Date
  77. Set-Date
    • Use: Sets the system time on the computer to a specified date and time.
    • Example: Set-Date -Date "March 10, 2024 5:00PM"
  78. Get-Random
    • Use: Gets a random number or selects objects randomly from a collection.
    • Example: Get-Random -Minimum 1 -Maximum 100
  79. Measure-Object
    • Use: Calculates the numeric properties of objects, and the characters, words, and lines in string objects, such as files or files in directories.
    • Example: Get-Process | Measure-Object -Property WS -Sum
  80. New-Object
    • Use: Creates an instance of a .NET Framework or COM object.
    • Example: New-Object -TypeName System.DateTime
  81. Out-GridView
    • Use: Sends output to an interactive table in a separate window.
    • Example: Get-Process | Out-GridView
  82. ConvertFrom-Csv
    • Use: Converts object properties in comma-separated value (CSV) format into CSV versions of the original objects.
    • Example: $csv = "Name,AgenJohn,30nJane,29"; $csv | ConvertFrom-Csv
  83. ConvertTo-Csv
    • Use: Converts .NET objects into a series of comma-separated value (CSV) strings.
    • Example: Get-Process | Select-Object -First 5 | ConvertTo-Csv
  84. Get-ExecutionPolicy
    • Use: Gets the PowerShell execution policies for the current session.
    • Example: Get-ExecutionPolicy
  85. Get-ChildItem
    • Use: Gets the items and child items in one or more specified locations.
    • Example: Get-ChildItem -Path C:\Windows -Recurse
  86. Set-Item
    • Use: Changes the value of an item to the value specified in the command.
    • Example: Set-Item -Path env:PATH -Value "$($Env:PATH);C:\MyApp\bin"
  87. Get-EnvironmentVariable
    • Use: Gets the value of an environment variable.
    • Example: Get-ChildItem Env:Path
  88. Set-EnvironmentVariable
    • Use: Sets the value of an environment variable.
    • Example: [System.Environment]::SetEnvironmentVariable('TestVariable', 'TestValue', [System.EnvironmentVariableTarget]::User)
  89. Get-CimSession
    • Use: Retrieves the CIM session objects from the current session.
    • Example: Get-CimSession
  90. New-CimSession
    • Use: Creates a new CIM session.
    • Example: New-CimSession -ComputerName Server01
  91. Invoke-CimMethod
    • Use: Invokes a method of a CIM class.
    • Example: Invoke-CimMethod -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine='notepad.exe'}
  92. Get-CimInstance
    • Use: Retrieves a list of CIM instances based on class or instance criteria.
    • Example: Get-CimInstance -ClassName Win32_Process
  93. Register-ScheduledJob
    • Use: Registers a background job that runs a PowerShell command or script at a set time or in response to a triggering event.
    • Example: Register-ScheduledJob -Name "MyJob" -ScriptBlock {Get-Date} -Trigger (New-JobTrigger -At 3:00am -Daily)
  94. Get-ScheduledJob
    • Use: Gets scheduled jobs that have been registered in the current session.
    • Example: Get-ScheduledJob
  95. Start-Sleep
    • Use: Suspends the activity in a script or session for the specified period of time.
    • Example: Start-Sleep -Seconds 10
  96. Convert-Path
    • Use: Converts a path from a PowerShell path to a provider path.
    • Example: Convert-Path -Path "HKCU:\"
  97. Resolve-Path
    • Use: Resolves the wildcard characters in a path and displays the path contents.
    • Example: Resolve-Path -Path "C:\Program*\*"
  98. ConvertTo-Xml
    • Use: Converts PowerShell objects into an XML string.
    • Example: Get-Process | Select-Object -First 5 | ConvertTo-Xml
  99. Export-Clixml
    • Use: Exports PowerShell objects to an XML file.
    • Example: Get-Service | Export-Clixml -Path services.xml
  100. Import-Clixml
    • Use: Imports a CLIXML file and creates corresponding PowerShell objects.
    • Example: $services = Import-Clixml -Path services.xml
  101. Join-Path
    • Use: Combines a path and a child path into a single path.
    • Example: Join-Path -Path "C:\Windows" -ChildPath "System32"
  102. Split-Path
    • Use: Returns the specified part of a path.
    • Example: Split-Path -Path "C:\Windows\System32\cmd.exe" -Leaf
  103. Push-Location
    • Use: Pushes the current location onto the location stack.
    • Example: Push-Location -Path C:\Windows
  104. Pop-Location
    • Use: Pops a location from the location stack.
    • Example: Pop-Location
  105. Get-Location
    • Use: Gets the current working directory.
    • Example: Get-Location
  106. Set-Location
    • Use: Sets the current working directory.
    • Example: Set-Location -Path C:\Windows
  107. New-ItemProperty
    • Use: Creates a new property for an item and sets its value.
    • Example: New-ItemProperty -Path "HKCU:\Software\MyApp" -Name "Setting" -Value "Value" -PropertyType String
  108. Get-ItemProperty
    • Use: Retrieves the properties of an item.
    • Example: Get-ItemProperty -Path "HKCU:\Software\MyApp" -Name "Setting"
  109. Set-ItemProperty
    • Use: Changes the value of an item property.
    • Example: Set-ItemProperty -Path "HKCU:\Software\MyApp" -Name "Setting" -Value "NewValue"
  110. Remove-ItemProperty
    • Use: Deletes a property and its value from an item.
    • Example: Remove-ItemProperty -Path "HKCU:\Software\MyApp" -Name "Setting"
  111. Test-NetConnection
    • Use: Displays diagnostic information for a connection.
    • Example: Test-NetConnection -ComputerName google.com
  112. New-Guid
    • Use: Generates a new globally unique identifier (GUID).
    • Example: New-Guid
  113. Get-FileHash
    • Use: Computes the hash value for a file by using a specified hash algorithm.
    • Example: Get-FileHash -Path C:\path\to\file.txt -Algorithm SHA256
  114. New-Alias
    • Use: Creates a new alias in the current PowerShell session.
    • Example: New-Alias -Name list -Value Get-ChildItem
  115. Get-Alias
    • Use: Retrieves a list of aliases in the current session.
    • Example: Get-Alias
  116. Set-Alias
    • Use: Creates or changes an alias for a cmdlet or other command element.
    • Example: Set-Alias -Name c -Value Clear-Host
  117. Remove-Alias
    • Use: Removes an alias from the current session.
    • Example: Remove-Alias -Name list
  118. Get-PSSnapin
    • Use: Gets the PowerShell snap-ins on the computer.
    • Example: Get-PSSnapin
  119. Add-PSSnapin
    • Use: Adds one or more Windows PowerShell snap-ins to the current session.
    • Example: Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
  120. Remove-PSSnapin
    • Use: Removes PowerShell snap-ins from the current session.
    • Example: Remove-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
  121. Get-TraceSource
    • Use: Lists PowerShell components that are instrumented for tracing.
    • Example: Get-TraceSource
  122. Set-TraceSourceUse: Configures and starts PowerShell components tracing. – Example: Set-TraceSource -Name "System.Management.Automation.Runspaces" -Option MatchAll
  123. Get-WinEventUse: Retrieves event log entries from local and remote systems. – Example: Get-WinEvent -LogName System -MaxEvents 10
  124. New-TemporaryFileUse: Creates a temporary file. – Example: $tempFile = New-TemporaryFile
  125. Get-DiskUse: Retrieves disk information. – Example: Get-Disk
  126. Initialize-DiskUse: Initializes a RAW disk for first-time use. – Example: Initialize-Disk -Number 1 -PartitionStyle MBR
  127. Get-PartitionUse: Retrieves partition information. – Example: Get-Partition
  128. New-PartitionUse: Creates a new partition on a disk. – Example: New-Partition -DiskNumber 1 -Size 500GB -AssignDriveLetter
  129. Format-VolumeUse: Formats a volume. – Example: Format-Volume -DriveLetter D -FileSystem NTFS
  130. Get-VolumeUse: Retrieves volume information. – Example: Get-Volume
  131. Optimize-VolumeUse: Optimizes a volume. – Example: Optimize-Volume -DriveLetter C -Analyze -Defrag
  132. Remove-PartitionUse: Removes a partition from a disk. – Example: Remove-Partition -DriveLetter F
  133. Get-BitLockerVolumeUse: Retrieves information about BitLocker-protected volumes. – Example: Get-BitLockerVolume -MountPoint "C:"
  134. Enable-BitLockerUse: Enables BitLocker protection on a volume. – Example: Enable-BitLocker -MountPoint "C:" -UsedSpaceOnly -RecoveryPasswordProtector
  135. Disable-BitLockerUse: Disables BitLocker protection on a volume. – Example: Disable-BitLocker -MountPoint "C:"
  136. Lock-BitLockerUse: Prevents access to BitLocker-encrypted data by locking a volume. – Example: Lock-BitLocker -MountPoint "D:"
  137. Unlock-BitLockerUse: Unlocks a BitLocker-encrypted volume. – Example: Unlock-BitLocker -MountPoint "D:" -Password (ConvertTo-SecureString -AsPlainText "yourPassword" -Force)
  138. Get-CredentialUse: Prompts the user for a username and password and creates a credential object. – Example: $cred = Get-Credential
  139. New-ScheduledTaskUse: Creates an object that represents a scheduled task. – Example: $action = New-ScheduledTaskAction -Execute 'Notepad.exe'; New-ScheduledTask -Action $action -Trigger (New-ScheduledTaskTrigger -AtLogon)
  140. Register-ScheduledTaskUse: Registers a scheduled task definition on a local computer. – Example: Register-ScheduledTask -TaskName "MyTask" -InputObject $task
  141. Get-ScheduledTaskUse: Retrieves scheduled task definitions. – Example: Get-ScheduledTask -TaskName "MyTask"
  142. Unregister-ScheduledTaskUse: Deletes a registered scheduled task. – Example: Unregister-ScheduledTask -TaskName "MyTask" -Confirm:$false
  143. Export-PfxCertificateUse: Exports a certificate to a PFX file. – Example: Export-PfxCertificate -Cert cert:\LocalMachine\My\ -FilePath "C:\cert.pfx" -Password (ConvertTo-SecureString -String "password" -Force -AsPlainText)
  144. Import-PfxCertificateUse: Imports a certificate from a PFX file to a certificate store. – Example: Import-PfxCertificate -FilePath "C:\cert.pfx" -CertStoreLocation Cert:\LocalMachine\My -Password (ConvertTo-SecureString -String "password" -Force -AsPlainText)
  145. Get-CertificateUse: Retrieves a certificate from a local or remote certificate store. – Example: Get-Certificate -DnsName "www.example.com" -CertStoreLocation "Cert:\LocalMachine\My"
  146. New-SelfSignedCertificateUse: Creates a new self-signed certificate for testing purposes. – Example: New-SelfSignedCertificate -DnsName "www.example.com" -CertStoreLocation "Cert:\LocalMachine\My"
  147. Test-CertificateUse: Tests a certificate and certificate chain for validity. – Example: Test-Certificate -CertPath "C:\cert.cer"
  148. Compare-ObjectUse: Compares two sets of objects. – Example: Compare-Object -ReferenceObject $(Get-Content file1.txt) -DifferenceObject $(Get-Content file2.txt)
  149. Group-ObjectUse: Groups objects that contain the same value for specified properties. – Example: Get-Process | Group-Object -Property ProcessName
  150. Sort-ObjectUse: Sorts objects by property values. – Example: Get-Process | Sort-Object -Property CPU -Descending
  151. Tee-ObjectUse: Saves command output in a file or variable and also sends it down the pipeline. – Example: Get-Process | Tee-Object -FilePath processes.txt
  152. Write-OutputUse: Sends the specified objects to the next command in the pipeline. – Example: Write-Output "Hello, World!"
  153. Write-HostUse: Writes customized output to a host/screen. – Example: Write-Host "Hello, World!" -ForegroundColor Cyan
  154. Write-WarningUse: Writes a warning message. – Example: Write-Warning "This is a warning message."
  155. Write-ErrorUse: Writes an error message to the error stream. – Example: Write-Error "This is an error message."
  156. Write-VerboseUse: Writes text to the verbose message stream. – Example: Write-Verbose "This is a verbose message." -Verbose
  157. Write-DebugUse: Writes debug information to the console. – Example: Write-Debug "Debugging information."
  158. Start-TranscriptUse: Starts a transcript of all subsequent commands in the session. – Example: Start-Transcript -Path "C:\transcript.txt"
  159. Stop-TranscriptUse: Stops the transcription process. – Example: Stop-Transcript
  160. Get-HotFixUse: Retrieves information about Windows updates installed on the computer. – Example: Get-HotFix
  161. Add-ContentUse: Appends content to a specified item (e.g., a file). – Example: Add-Content -Path "log.txt" -Value "New log entry"
  162. Checkpoint-ComputerUse: Creates a system restore point on the local computer. – Example: Checkpoint-Computer -Description "Pre-Upgrade Snapshot"
  163. Get-ComputerInfoUse: Retrieves a comprehensive set of system properties and configurations. – Example: Get-ComputerInfo
  164. Get-CounterUse: Retrieves live performance counter data from local or remote computers. – Example: Get-Counter -Counter "\Processor(_Total)\% Processor Time" -SampleInterval 2 -MaxSamples 5
  165. Get-CultureUse: Retrieves information about the current culture settings. – Example: Get-Culture
  166. Get-DateUse: Gets the current date and time. – Example: Get-Date -Format "yyyy-MM-dd HH:mm:ss"
  167. Set-DateUse: Sets the system date and time. – Example: Set-Date -Date "2024-03-15 8:00 AM"
  168. Get-DscConfigurationUse: Retrieves the current configuration from a node. – Example: Get-DscConfiguration
  169. Start-DscConfigurationUse: Applies Desired State Configuration (DSC) configurations to nodes. – Example: Start-DscConfiguration -Path .\Configuration -Wait -Verbose
  170. Get-EventSubscriberUse: Lists event subscribers in the current session. – Example: Get-EventSubscriber
  171. Register-ObjectEventUse: Subscribes to events generated by .NET objects. – Example: $timer = New-Object timers.timer 10000; Register-ObjectEvent -InputObject $timer -EventName Elapsed -Action { Write-Host "Timer elapsed!" }
  172. Unregister-EventUse: Cancels an event subscription. – Example: Unregister-Event -SubscriptionId 1

Related Videos:


Related Posts:

Coding Autorun.inf Script Virus

Understanding Secure Connections: A Comprehensive Guide to SSH and SSL/TLS(Opens in a new browser tab)

How do I activate my Windows 10? and rid myself of the watermark in the bottom right hand side?(Opens in a new browser tab)

Ai Pin: Transforming Everyday Life with Innovative Wearable Technology(Opens in a new browser tab)

What are references in C++?(Opens in a new browser tab)

Creative Kids After School Art Club(Opens in a new browser tab)

Top Tools for Ethical hacking in 2020

The Guide to Ethical Hacking

Introduction to Batch File Viruses

What is a Batch file?

Fork Bomb Batch File Virus

Introduction to JavaScript – CONSOLE

Kodi add-on structure

How to download and install Alice 3

USB O.MG cable opens Wi-Fi to remote attacks

What is Unity3D?

Microsoft Office 2016 Activation, as a batch file

Windows 10 Activator Key, Activate Windows 10 with a batch file

Microsoft warns wormable Windows bug could lead to another WannaCry

How to open and use the Terminal app on a Mac computer, with a few basic commands

How to make Windows 10 look and feel like Windows 7

Exit mobile version