Font color is termed as the Foreground color in the PowerShell. To change the font color you can use the console GUI property “Screen Text”. There are various 16 colors available and you can change RGB properties as well.CommandTo change the color with the script, use the below command.$Host.UI.RawUI.ForegroundColor = "Yellow"OutputYou can see the immediate change in the Foreground color.
To get only folders excluding files, we need to use –Attribute parameter with Directory attribute.CommandGet-ChildItem D:\Temp\ -Attributes DirectoryOutputDirectory: D:\Temp Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 13-12-2019 09:52 GPO_backup d----- 24-11-2018 11:31 LGPOSimilarly, you can combine different operations.To get the only system directories, use the below command.Get-ChildItem D:\Temp\ -Attributes Directory –System -RecurseTo get the system directories that are hidden.Get-ChildItem D:\Temp\ -Attributes Directory -Recurse –System -HiddenTo get the system directories which are Readonly.Get-ChildItem D:\Temp\ -Attributes Directory -Recurse –System -Readonly
For various reasons, you need to change the title of the PowerShell console. Like the title to describe the script. For example, System Information or Service Information.To change the PowerShell Console Title use the “WindowsTitle” property in RawUI. It is just a temporary change. When you close the console and open it again, the title will be set to the default.$host.UI.RawUI.WindowTitle = "System Information"Now the title of the PowerShell console is changed to “System Information”.You can also supply variable value to this parameter.$Title = "System Information" $host.UI.RawUI.WindowTitle = $Title
You can check the Powershell console properties in two ways. The first method is by right-clicking on the title bar and open the properties.For Example,CommandYou can find various properties there. Like Windows Size, Cursor size, Font Size, font colors, etc. But you can dynamically change the properties when the script runs using the RawUI properties in the $host UIconfiguration. You can view the properties of the console using the below command, which is the second method.$host.UI.RawUIOutputForegroundColor : DarkYellow BackgroundColor : Black CursorPosition : 0,6 WindowPosition : 0,0 CursorSize : 25 BufferSize : 120,3000 WindowSize : 120,43 MaxWindowSize : 120,44 MaxPhysicalWindowSize : 151,44 KeyAvailable : False WindowTitle : Administrator: Windows PowerShell
To get only files, you need to use NOT operator in Directory attribute parameter.ExampleGet-ChildItem D:\Temp\ -Attributes !DirectoryOutputirectory: D:\Temp Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 07-05-2018 23:00 301 cars.xml -a---- 29-12-2017 15:16 4526 healthcheck.htm -a---- 29-12-2017 15:16 4526 healthcheck1.htm -ar--- 13-01-2020 ... Read More
In this article, we will learn about – How to install and configure MS SQL on CentOS 7. Microsoft has recently announced that they are planning to release the MS SQL for Linux. Specially the beta versions for RedHat enterprises Linux, Centos & Ubuntu but only with 64-bit editions.PrerequisitesA machine with a minimum of 4 GB RAM and 30 GB Hard disk space.A machine installed with CentOS 7.A user with root privileges or root user.MS SQL Server installation on CentOSSince MS SQL is not available with the default CentOS repository, we needed to add the MS SSQL repository details to ... Read More
In this article, we shall be learning about how to install Nginx on Ubuntu 16.04 and how to allow the Nginx from the firewall. Also, we will learn about how to control the Nginx.Nginx is a popular web server where most of the websites are hosted on the real world on the Nginx where it is more friendly than Apache and can be used as a Reverse proxy also.PrerequisitesIn this context (demo), we will need a non-root user with sudo privileges.Installing the Nginx on Ubuntu 16.04As a default, the Nginx is available with default Ubuntu repositories so that we can ... Read More
Artificial Intelligence is one the hot topic in the information and technology which predominantly includes general AI, machine learning, expert systems (which can be the same thing) data mining, Neural Networks and fuzzy systems. These topics have become the most wanted and essential topics among the scholars, students, faculties and professionals.As AI had already created enough impact among the public, this article would help the upcoming generation to know more about the career opportunities that are related to this domain. And we need to understand that fact that, Machine learning is the practical face of AI. It’s about identifying sources ... Read More
In this article, we will learn how to Install and Configure MS SQL on Ubuntu, Microsoft has recently announced that they are planning to release the MS SQL for Linux. Specially beta versions of Red Hat Enterprises Linux, Centos &, Ubuntu but only with 64-bit editions.PrerequisitesA Machine with a min of 4 GB RAM and 30 GB Hard disk space.A Machine installed with Ubuntu 16.04.A user with root privileges or root user.MS SQL Server installation on UbuntuAs the MS SQL is not available in the default Ubuntu repository we needed to add the MS SSQL repository details to the local ... Read More
Below attribute parameters are supported in Get-ChildItem in PowerShell.Get-ChildItem Alias Reference: --------------------------------- Get-ChildItem dir Directory d, ad File af Hidden h, ah ReadOnly ar System as
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP