Introduction

As per the Microsoft documentation, "PowerShell is a cross-platform task automation and configuration management framework, consisting of a command-line shell and scripting language. Unlike most shells, which accept and return text, PowerShell is built on top of the .NET Common Language Runtime (CLR) and accepts and returns .NET objects. This fundamental change brings entirely new tools and methods for automation."
While working on PowerShell there are few basic but important commands which make life easier. I tried to list and explain them below.

Get-Location

This command is used to get the location of the current Directory.

Write-Host

This command is mainly used to display or print the output, it can be text, message, variable value, or anything that the developer wants to print. you can pass some parameters to print in a specific format. For example, you can use ForegroundColor to print in specific color or BackgroungColor to print output in the specific background color. Below is the sample code to understand more.
  • Write-Host"I am using CSharp Corner to share my knowledge" -ForegroundColor red -BackgroundColor white

Get-Content

This command is used to get the text or content from the file or from the function. you need to specify the path of the file in case of getting the contents from the file.

Set-Content

This command is used to write content to the file.
  • Set-Content -Path .\Test.txt -Value'Hello World'

New-Item

This command is used to create a new item, file, or directory at a specified location or path. If you are creating the file with this command you can write content in the file with the same command

Copy-Item

This command copies an item from one location to another. This command doesn’t cut or delete any file. It can copy and rename in the same command.

Compress-Archive

Creates a compressed archive, or zipped file from specified files and directories.

Expand-Archive

Extracts files from a specified archive (zipped) file.
There are many important commands available, however, I used the above command frequently while working on PowerShell scripting. As a developer, we can do almost everything after application development with the PowerShell. This scripting is an add-on to the skills of the developers, even POC knowledge is also adds huge capability.
--Happy Coding--