- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 463 Articles for PowerShell
7K+ Views
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.
5K+ Views
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
627 Views
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
7K+ Views
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
1K+ Views
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
977 Views
System files are operating system files and are not visible by default using Get-ChildItem. To get the system files you need to use –System parameter.ExampleFor example, below command will provide you system files and folders under C:\Windows\System32.PS C:\WINDOWS\system32> Get-ChildItem -SystemOutputDirectory: C:\WINDOWS\system32 Mode LastWriteTime Length Name ---- ------------- ------ ---- d---s- 25-12-2019 01:14 AppV d---s- 19-03-2019 10:22 ... Read More
909 Views
To get the Readonly files with Get-ChildItem in PowerShell, you need to use the –Readonly files. Readonly file has attribute ‘r’.In the below example, you can check the attribute of the file.Get-ChildItem D:\Temp\ -ReadOnlyOutputPS C:\WINDOWS\system32> Get-ChildItem D:\Temp\* -ReadOnly Directory: D:\Temp Mode LastWriteTime Length Name ---- ------------- ------ ---- -ar--- 13-01-2020 18:19 0 Readonlyfile.txtYou can check the read-only attribute value in Mode property.
To Continue Learning Please Login
Login with Google