-likeuses wildcards for pattern matching Get-ChildItem D:\MSSQL2K8\*.* -include *.mdf | where-object {$_.name -like “M*”} You can use the this next script to find large files. In the script you have to specify
A regular expression, also known as regex, is aspecial sequence of characters used to match a pattern in a string.For example, you can build a regular expression to find a credit card number inside a string. You start by constructing a pattern to match the sequence of four groups th...
To find the static properties and methods of an object, use the Static parameter of the Get-Member cmdlet. The member name may be an expression. PowerShell Copy [datetime]::Now 'MinValue', 'MaxValue' | ForEach-Object { [int]:: $_ } Ternary operator ? <if-true> : <if-false>...
Fix GitHub Action filter overmatching (#24929) Add UseDotnet task for installing dotnet (#24905) Convert powershell/PowerShell-CI-macos to GitHub Actions (#24914) Convert powershell/PowerShell-CI-linux to GitHub Actions (#24913) Convert powershell/PowerShell-Windows-CI to GitHub Actions (#...
If you want to replace a value with a different one, specify the new one after the pattern you want to replace. SQL Saturday in Baton Rouge is an event I try to speak at every year. In the following example, the word "Saturday" is replaced with the abbreviation "Sat". PowerShell Cop...
Get-Command-Namedir-Syntaxdir (alias) ->Get-ChildItemdir [[-Path] <string[]>] [[-Filter] <string>] [-Include <string[]>] [-Exclude <string[]>] [-Recurse] [-Depth <uint>] [-Force] [-Name] [-Attributes <FlagsExpression[FileAttributes]>] [-FollowSymlink] [-Directory] [-File] ...
Find Smallest Number in INT array Find specific users in Active Directory with Powershell. find string in HTML file Find String Starting Position with regex Find string using pattern and return only the matched string Find the number of times a character '\' exists in a string Find the third...
Register the snapin. From the directory that contains the snapin assembly, runInstallUtil SnapinFilename.dll. This command lets all users on the computer load and run commands defined by the snapin. You can find the InstallUtil utility in the .NET Framework’s installation directory—commonly...
Edits a file using a regex pattern to find text to be replaced by a specified replacement string. FileTail Get-FileTail Tails the contents of a file - optionally waiting on new content. FileTime Set-FileTime Sets a file or folder's created and last accessed/write times. ...
-FilterPattern <String> A filter pattern for subscribing to a filtered stream of log events. Required?True Position?3 Accept pipeline input?True (ByPropertyName) -Force <SwitchParameter> This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should...