Found 989 Articles for Software & Coding

How to create PowerShell alias permanently?

Chirag Nagrekar
Updated on 14-Feb-2020 08:07:54

4K+ Views

PowerShell alias can be created permanently by 2 methods below.a) Import / Export AliasTo export all the aliases, you need to use Export-Alias cmdlet. When you use this command it will ask you the path for the file to import.To export the newly created alias, you need to give alias name and the name for the export, so later you can import it with the same name.In the below example, we have created alias name Edit for the Wordpad and we will export all the aliases with the name Alias1, so the newly created alias will also be stored and ... Read More

How to create new alias with PowerShell?

Chirag Nagrekar
Updated on 14-Feb-2020 08:06:31

472 Views

Anyone can create a new alias which is a shortcut to another command. To create your own alias you need to use Set-Alias cmdlet. Here, we will create a new alias Edit, which will open a Notepad.exe. First, we will check if Edit alias exists or not.$Alias:EditAs this is going to be a new Alias there will be no output for it. Now, we will create new alias by the below command. You can provide any program path and create an alias for it.Set-Alias Edit Notepad.exeJust check if this Edit alias created successfully or not.PS E:\scripts\Powershell> $Alias:Edit Notepad.exeThis new alias ... Read More

How to get all the aliases in PowerShell?

Chirag Nagrekar
Updated on 14-Feb-2020 08:05:45

309 Views

In PowerShell, you will get all the alias and their commands using Alias: drive as shown below.Dir Alias:OutputHere, Alias: is the drive but surprisingly you will not find it in your operating system. This is the virtual drive and there are other virtual drives as well. You can list all the virtual drives using the below command.Get-Alias will provide the same result.The above output provides the individual alias and their commands for it. But to group them based on their cmdlets, you need to use Group-Object command.Dir Alias: | Group-Object DefinitionOutputYou will see in the output that aliases are listed ... Read More

How to get/resolve the command from the alias in PowerShell?

Chirag Nagrekar
Updated on 14-Feb-2020 08:03:32

276 Views

To resolve the command name from given alias, you need to use the below command.$Alias:AliasNameFor example, $Alias:dirOR$Alias:lsOutputGet-ChildItemThis means the above commands will provide the same result. For example, the output of the below commands would remain the same.Get-ChildItem C:\ Dir C:\ ls COutputYou can also use Get-Alias to resolve the alias name. For example, Get-Alias -Name dirGet-Alias -Name lsUntil now we need to remember alias name to get the command and we were running individual commands to get the Alias and its command. It is possible to get all the alias names for the given command. To get all aliases ... Read More

What is an alias in PowerShell?

Chirag Nagrekar
Updated on 14-Feb-2020 08:02:55

165 Views

In general, Alias means giving command to other names. In system admin life, they want short and familiar commands. PowerShell has verb-noun cmdlets that are very systematic but not practical in everyday life. So the System admins use PowerShell alias. For example - Dir or ls for the Get-ChildItem, cat or gc for the Get-Content.

How to get the list of all the commands available in the PowerShell?

Chirag Nagrekar
Updated on 14-Feb-2020 08:01:44

2K+ Views

To get the list of all the commands installed in the system use the below command line. It will include all the Alias, Functions and Cmdlets.Get-CommandTo export them into the CSV file,Get-Command | Export-Csv D:\Temp\PowerShellcommands.csv - NoTypeInformationTo get only the cmdlets commands,Get-Command -CommandType CmdletSimilarly, you can get the commands for the alias and functions.If you want the list of commands starting with getting, you parameter –Verb.Get-Command -Verb GetTo get command starting with Set,Get-Command -Verb Set

How to start any program using PowerShell?

Chirag Nagrekar
Updated on 14-Feb-2020 08:01:03

12K+ Views

If you have noticed, you can start notepad and calculator or other standard system utilities with the Windows Run or through the PowerShell console directly by typing just their names, but not the wordpad.exe, word, excel or any other application. It will throw an exception.For example, just type notepad.exe in PowerShell console and it will open the program but type wordpad.exe there will be an error.wordpad.exe − The term 'wordpad.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the ... Read More

How to use PowerShell as a Calculator? Or How to use PowerShell for arithmetic operations?

Chirag Nagrekar
Updated on 14-Feb-2020 08:00:00

1K+ Views

You can use the PowerShell console to perform arithmetic operations, the same way the calculator does.To do the addition operation, 2+3Output − 5For complex, additional operations as well it is too quick.10024455 + 554668 + 9964455Output − 20543578Floating numbers operation, 5569899.65 + 554886.32Output − 6124785.97To perform subtract operation, 55564488556 - 55141256665 Output − 423231891With Integer and floating number subtraction, 5569899 - 554886.32Output − 5015012.68Divide Operation, 556989 / 554Output − 1005.39530685921Multiplication operation, 5533 * 445Output − 2462185Multiple Operations, (445 + 5443) * 332 / 32 Output − 61088When you perform any arithmetic operation, when values separated by command, it will give ... Read More

Frequently Used Examples of ‘Fuser’ Command in Linux

Samual Sam
Updated on 28-Jan-2020 12:24:30

254 Views

The fuser utility in Linux is a very smart Unix utility. As the name suggests, it offers knowledge about file user or the process that is currently utilizing the file or directory. This article explains about – Frequently used examples of ‘fuser’ Command in Linux.To get the more information about fuser, use the following command –$ fuserThe sample output should be like this –Usage: fuser [-fMuvw] [-a|-s] [-4|-6] [-c|-m|-n SPACE] [-k [-i] [-SIGNAL]] NAME... fuser -l fuser -V Show which processes use the named files, sockets, or filesystems. -a, --all             display unused files ... Read More

Difference between monolithic and microservices architecture

Mahesh Parahar
Updated on 27-Jan-2020 10:37:48

13K+ Views

Monolithic architecture  is built as one large system and is usually one code-base. Monolithic application is tightly coupled and entangled as the application evolves, making it difficult to isolate services for purposes such as independent scaling or code maintainability.It extremely difficult to change technology or language or framework because everything is tightly coupled and depend on each other.Microservices architecture is built as small independent module based on business functionality. In microservices application, each project and services are independent from each other at the code level. Therefore it is easy to  configure and deploy completely and also easy to scale based ... Read More

Advertisements