- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Chirag Nagrekar has Published 465 Articles
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
216 Views
Generally, when the variable is declared as a Public variable or outside the function in the script (not in any other variable or condition), you don’t need to pass that value to function because the function retains the value of the variable when the variable is initialized before the function ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
767 Views
Function in a PowerShell is to reduce the redundancy of the repeated codes this means codes which are repeating, bind them into a function and call the function whenever necessary, so you don’t need to write codes multiple times.ExampleLet assume, you want to perform arithmetic operations (multiply, sum, divide and ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
10K+ Views
To sort the output in the PowerShell you need to use Sort-Object Pipeline cmdlet. In the below example, we will retrieve the output from the Get-Process command and we will sort the, according to memory and CPU usage.ExampleGet-Process | Sort-Object WorkingSet | Select -First 10OutputHandles NPM(K) PM(K) ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
2K+ Views
Measure-Object in PowerShell is used to measure the property of the command. There are various measurement parameters are available. For example, Average, Count, sum, maximum, minimum and more.ExampleGet-Process | Measure-ObjectOutputPS C:\WINDOWS\system32> Get-Process | Measure-Object Count : 278 Average : Sum : ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
630 Views
As the name suggests, Group-Object is useful to group similar properties.ExampleGet-Service | Group-Object StatusOutputCount Name Group ----- ---- ----- 160 Stopped {AarSvc_8f3023, AdobeFlashPlayerUpdateSvc, AJR outer, ALG...} 130 Running {AdobeARMservice, Appinfo, AudioEndpointBuilder, Audiosrv...}The above output ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
2K+ Views
To check the PowerShell version installed in your system, you can use either $PSVersionTable or $host command.Check if $host command available in remote servers.Open the PowerShell console in the system and run the command $PSVersionTable.$PSVersionTableOutputPS C:\WINDOWS\system32> $PSVersionTable Name ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
6K+ Views
To edit the CSV file using PowerShell, you need to use the below commands.We already have the CSV file output.csv, we will import this file first.$csvfile = Import-csv C:\temp\Outfile.csvOutputBelow is the output of the CSV file.EMP_Name EMP_ID CITY -------- ------ ---- Charles ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
36K+ Views
To append the data into CSV file you need to use –Append parameter while exporting to the CSV file.In the below example, we have created a CSV fileExample$outfile = "C:\temp\Outfile.csv" $newcsv = {} | Select "EMP_Name", "EMP_ID", "CITY" | Export-Csv $outfile $csvfile = Import-Csv $outfile $csvfile.Emp_Name = "Charles" $csvfile.EMP_ID = "2000" ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
4K+ Views
There are few methods to create a CSV file in the PowerShell, but we will use the best easy method to create it.First, to create a CSV file in PowerShell, we need to create headers for it. But before it, we need output file name along with its path.$outfile = ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
Chirag Nagrekar
1K+ Views
When you run a command Export-Csv in PowerShell, it automatically creates a CSV file to the specific location.ExampleGet-Service | Select Name, Starttype, Status | Export-Csv C:\temp\services.csv -NoTypeInformationIn the above example, Services.csv file created in C:\Temp folders with the header Name, Starttype, and Status headers.Similarly, you can use the other commands ... Read More