Chirag Nagrekar has Published 465 Articles

How to use ForEach-Object Parallel cmdlet in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 11-Nov-2020 12:45:15

2K+ Views

Foreach-Object -Parallel command was introduced in PowerShell version 7, preview 3, and it is used for the parallel execution of the pipeline input and more details on this have been explained in this article.Please Note: Foreach-Object and Foreach commands are the same but we can’t write Foreach -Parallel command because ... Read More

How to use stopwatch in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 11-Nov-2020 12:39:30

8K+ Views

To use the stopwatch in PowerShell, we need to use [System.Diagnostics.Stopwatch] class.We will create a new object for this class, $stopwatch = [System.Diagnostics.Stopwatch]::new()Below are the members of the above stopwatch mentioned class.PS C:\> $Stopwatch | gm TypeName: System.Diagnostics.Stopwatch Name MemberType Definition ---- ---------- ---------- Equals Method bool Equals(System.Object obj) ... Read More

How Ternary operator in PowerShell Works?

Chirag Nagrekar

Chirag Nagrekar

Updated on 11-Nov-2020 12:36:21

5K+ Views

The ternary operator in PowerShell was introduced with the PowerShell version7.0. The ternary operator has ‘?’ (question mark) symbol and its syntax is, [Condition] ? (output if True) : (output if false)The left side of the ternary operator is condition and the right side is output based on the condition ... Read More

How to use Compare-Object in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 11-Nov-2020 12:32:13

10K+ Views

Compare-Object command in PowerShell is used to compare two objects. Objects can be a variable content, two files, strings, etc. This cmdlet uses few syntaxes to show the difference between objects which is called side indicators.=> - Difference in destination object. Compare-Object "World" "Alpha" InputObject SideIndicator ----------- ------------- ... Read More

How to remove the mapped network drive using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 11-Nov-2020 12:25:13

13K+ Views

To remove mapped drives from PowerShell on windows systems, you can use both PowerShell and cmd commands.Using the cmd commandYou can use the below command for a single mapped drive-by specifying the disk drive letter or by using the wildcard character (*).To remove a single mapped drive.Examplenet use K: /deleteOutputPS C:\WINDOWS\system32> net use K: /delete K: was deleted successfully.To remove multiple ... Read More

How to map the network drive using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 11-Nov-2020 12:11:35

4K+ Views

You can map the network drive on the local and remote computers using several ways.Using cmd command.You can use the below command to map the network drive, here letter M, and the shared folder on the local computer.Examplenet use M: "\remoteshare\Shared Folder" PS C:\WINDOWS\system32> net use M: Local name        M: Remote name     ... Read More

How to get mapped drives using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 11-Nov-2020 12:00:32

17K+ Views

There are few methods to get the mapped network drive using PowerShell.CMD command method.You can use the cmd command net use in PowerShell to get the mapped drives.net useOutputPS C:\WINDOWS\system32> net use New connections will be remembered. Status       Local     Remote                    Network ------------------------------------------------------------------------------- OK ... Read More

How to display multiple outputs on an HTML webpage using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 11-Nov-2020 11:57:39

954 Views

Consider you have multiple outputs to display on the webpage using PowerShell and we will use the Convertto-HTML built-in cmdlet for it but to display them properly, we first need to convert each part into fragment using –Fragment parameter.Let’s just take the simple example without the –Fragment parameter. In the ... Read More

How to use CSS style in PowerShell HTML Output?

Chirag Nagrekar

Chirag Nagrekar

Updated on 11-Nov-2020 11:54:03

4K+ Views

Cascading Style Sheets (CSS) in general used for formatting HTML with styles. It describes how the HTML elements should be displayed.Once we get the output from the Convertto-HTML command, we can use the CSS style to make the output more stylish.Consider we have the below example for converting the services ... Read More

Explain HTML formatting in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 11-Nov-2020 11:43:02

2K+ Views

HTML is another form of output in PowerShell. It is the rich form of output and you can use various CSS styles to make the output more interactive. We will use the Convertto-HTML cmdlet to convert the output in the HTML format.Here is the Syntax of the Convertto-HTML cmdlet.ExampleConvertTo-Html   ... Read More

Advertisements