IT Blog

Uncategorized

Windows PowerShell

As you know, in the operating systems developed by Microsoft so far, GUI (Graphical User Interface) has been prioritized in order to provide convenience for users. Thus, it provided easy use to its users. However, in the MS Server operating system family, it was sometimes necessary to dig deep into the system and these operations could not be fully configured from the ms-dos screen. However, operating systems such as Unix and Linux mostly used CLI (Command Line Interface), so system administrators were able to run stable applications to enter the internal points of the system. Microsoft also developed the Powershell software, now Microsoft System engineers, system developers will be able to freely navigate to the end points of the system on Microsoft Servers and Clients and create stable systems. Well, how of course POWERSHELL …

    Powershell is a command line based scripting language designed for system administrators and power users. Supports .NET Framework library, helps Powershell Users to automate the management and control of applications running on windows. Powershell has a rich and developed coding language. NET commands can be used as well as Powershell because it already uses .NET framework. Even small-scale programs can be used to develop applications. It is a more content-rich design than ms-dos that works consistently and stable, allowing us to perform GUI operations in a shorter time with a few commands. Sample Figure1

NOTE: In addition to using the Powershell .NET library, it provides great convenience to manage the system by using this library to write scripts.

    Powershell Windows Server 2008 and Windows 7 also come as default. It can be used in Windows XP SP2, Windows Vista, Windows 2003 SP 1. Click the link below to download versions according to the operating system.

Using

    Powershell As we mentioned above, commands in Powershell are similar to .NET commands and we can say that they are the same.

    To access the Powershell screen, just click Start à All programs à Accessories à Windows Powershell in Windows 7. If this is too long, just type Powershell.exe into Run. You will see the blue screen shown in Figure 1 below. (If it is run from the command line, a black screen will appear, so don’t be confused.)


Figure-1

Powershell Commands

    The get command is used to pull data, that is, to reach an operation we want to see. The set command is used to add any entry to our computer. As an example, let’s see the Processes on our computer using the Get command.


Figure-2

    We even said that we are not satisfied with this, or we use the .NET Framework library and support many languages, so let’s ask our computer to count from 1 to 20. The command we will use for this is PS C: \ Users \ PC> ”$ say = 1..20 ″ Enter then it will be enough to say“ $ say ”. The commands are in quotes. (Used without nails.)


Figure-3

    Many commands can be operated in Powershell. It is impossible to cover all of these in this article. Since it is possible to operate from system management to the lungs of the computer, let’s perform operations with some .NET-based commands. Various operations can be performed using some commands such as Cmdlet, Alias. We should think of these commands as a category because they contain hundreds of commands in their internal structures. First of all, it is necessary to explain these commands.

    Cmdlet: It allows us to manage the computer from the command line. For example, the registry provides easy access to data stores and file system. There are 129 standard cmdlet commands for performing Windows system administration tools, event logs, services, and operations.

    Alias ​​(alias):You can apply abbreviations for a command that you use constantly on the Powershell screen, for example, you will perform a deletion, you can use it with Alias ​​instead of remove item. Below are examples used with Alias.

    We can define a new alias with the set command mentioned above. In other words, we can give a nickname to a command we want to use and call that command with the alias we define with the set parameter we give. For example, let’s define get-process as ba command “Set-alias ba Get-process”

    . It will be sufficient to write “get-alias” or just “alias” as the command.

Figure-4

Figure-5

    Is that all? No, of course there are hundreds of commands according to the process we want to perform. Well, there is no help or a convenience Microsoft Powershell has thought of this for us.

Powershell Help Command

    If you want help with any command. Simply say “Help” command or “Get-help”, the screen required for help will be displayed.

    If you want to get information about other commands of a command you are processing, the “Help” command will be useful. If you want to get information about the service or you want to view other commands you will use for the service, it will be enough to say “Get-help service”.


Figure-6

    As seen in Figure 6, we can stop the service, start it, wait it, restart it. In fact, it seems difficult to use Powershell as we are used to using the GUI when it is a bit tampered with, but there is not much to fear.

    Now we know a little bit about Powershell, it is up to you to develop and use it. With Powershell, we are free.

Leave a Reply

Your email address will not be published. Required fields are marked *