Microsoft Technologies Articles

Page 169 of 175

How to change the Title of the console using PowerShell command?

Chirag Nagrekar
Chirag Nagrekar
Updated on 23-Jan-2020 6K+ 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

Read More

How to check the properties of the Windows PowerShell Console?

Chirag Nagrekar
Chirag Nagrekar
Updated on 23-Jan-2020 1K+ 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

Read More

How to get only files but not the folders with Get-ChildItem using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 23-Jan-2020 9K+ 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

Which attribute parameters are supported in Get-ChildItem in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 23-Jan-2020 633 Views

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

Read More

How to get the system files using the Get-ChildItem in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 23-Jan-2020 2K+ 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

How to get the readonly files using Get-ChildItem in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 23-Jan-2020 1K+ 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.

Read More

How to exclude specific file names using Get-ChildItem in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 23-Jan-2020 4K+ Views

To exclude specific file(s) from being displayed in the output of Get- ChildItem, you need to specify the file name(s).CommandGet-ChildItem D:\Temp\ -Recurse -Exclude style.css, LGPO.exeOutputDirectory: D:\Temp\LGPO Mode                LastWriteTime         Length Name ----                -------------         ------ ---- -a----       01-06-2017     02:25         638115 LGPO.pdf     Directory: D:\Temp Mode                LastWriteTime         Length Name ----                -------------     ...

Read More

How to exclude specific extension in Get-ChildItem in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 23-Jan-2020 4K+ Views

To exclude specific extensions, you need to use –Exclude parameter in Get-ChildItem.ExampleFor example, as shown below when we run command, it will exclude .html files and display the rest.Get-ChildItem D:\Temp\ -Recurse -Exclude *.htmlOutputDirectory: D:\Temp Mode                LastWriteTime         Length Name ----                -------------         ------ ---- d-----       24-11-2018     11:31                LGPO     Directory: D:\Temp\LGPO Mode                LastWriteTime         Length Name ---- ...

Read More

How to use the wildcard character (*) in Get-ChildItem in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 23-Jan-2020 3K+ Views

You can also search for files with a specific name or using the wildcard (*) character.CommandBelow command will search for the files (including hidden files) starting with “Bac”.Get-ChildItem D:\Temp -Recurse -Force -Include Bac*OutputPS C:\WINDOWS\system32> Get-ChildItem D:\Temp -Recurse -Force -Include Bac*     Directory: D:\Temp\GPO_backup\{C9C3DB4C-2E51-4201-B3C3-7C0F1ACECBE9} Mode                LastWriteTime         Length Name ----                -------------         ------ ---- -a----       24-11-2018     11:34           6215 Backup.xmlCommandWhen you use the wildcard character (*) at both the ends, file ...

Read More

How to use Get-ChildItem in PowerShell to filter a specific extension?

Chirag Nagrekar
Chirag Nagrekar
Updated on 23-Jan-2020 20K+ Views

To get the output of the get-childitem with a specific extension, we need to use –includeparameter.ExampleIn the below example, we will use the below script to get only .xml files.Get-ChildItem D:\Temp\ -Recurse -Include *.xmlOutputPS C:\WINDOWS\system32> Get-ChildItem D:\Temp\ -Recurse -Include *.xml     Directory: D:\Temp\GPO_backup\{C9C3DB4C-2E51-4201-B3C3-7C0F1ACECBE9} Mode                LastWriteTime         Length Name ----                -------------         ------ ---- -a----       24-11-2018     11:34           6215 Backup.xml -a----       24-11-2018     11:34       ...

Read More
Showing 1681–1690 of 1,744 articles
« Prev 1 167 168 169 170 171 175 Next »
Advertisements