Tag: Search

Windows 10 Cortana

How to hide Cortana Search Box in Windows 10

During the last Windows 10 event in January, Microsoft showed the Cortana integration in Windows 10 and with Windows 10 Technical Preview 2 (build 9926) Microsoft released it’s first public preview of Cortana for Windows 10. Cortana helps you to do a lot of great things and I am a huge fan since I am using Cortana on my Windows Phone. The problem I have with the integration is the huge text box Cortana uses. And I don’t really need that box since I use the Windows Key anyway to open search.

Windows 10 Cortana Search box

To disable or hide the Cortana Search Box simply right click on the Taskbar, select search and enable “Show search icon”.


Hide Windows 10 Cortana Search Box

Now you only see the Cortana Icon instead of the Cortana Search Box. You can still just start to type by pressing the Windows Key or clicking on the Cortana Icon.

Windows 10 Cortana Icon



Powershell: Search for String or grep for Powershell

This shows you how you can search in files for a specific content with Windows PowerShell. This  also “replaces” the Windows command-line utility “findstr”. In the Unix/Linux world you mostly use the command grep for doing the same. So you can think of Select-String as PowerShell version of Grep. The Select-String cmdlet searches for text and text patterns in input strings and files. You can use Select-String similar to grep in UNIX or findstr in Windows.

grep syntax

grep (options) files.txt

grep example

grep "text I search" *.log

In Windows PowerShell we can use the Select-String to search strings in files

Select-String -Path C:\temp\*.log -Pattern "Contoso"

If you need some more options, for example you need also check subfolders (-Recurse) or you need additional filter for files you wanna check, you can use the Get-Childitem first.

Get-ChildItem C:\temp -Filter *.log -Recurse | Select-String "Contoso"

If you have to copy all the files with a specific content, you can simply add a Copy-Item cmdlet.

Get-ChildItem C:\temp -Filter *.log -Recurse | Select-String "Contoso" | Copy-Item -Destination C:\temp2

More Information about Select-String on Microsoft Docs. Select-String can also be very useful to count your lines of code in different files using PowerShell.