mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-08 20:54:38 +02:00
Remove the #!/usr/bin/pwsh line
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
#!/usr/bin/pwsh
|
||||
<#
|
||||
.SYNTAX search-files.ps1 [<pattern>] [<path>]
|
||||
.DESCRIPTION searches the given pattern in the given files
|
||||
@ -7,6 +6,8 @@
|
||||
#>
|
||||
|
||||
param($Pattern = "", $Path = "")
|
||||
if ($Pattern -eq "" ) { $Pattern = read-host "Enter search pattern" }
|
||||
if ($Path -eq "" ) { $Path = read-host "Enter path to files" }
|
||||
|
||||
function ListScripts { param([string]$Pattern, [string]$Path)
|
||||
$List = Select-String -Path $Path -Pattern "$Pattern"
|
||||
@ -21,13 +22,6 @@ function ListScripts { param([string]$Pattern, [string]$Path)
|
||||
}
|
||||
|
||||
try {
|
||||
if ($Pattern -eq "" ) {
|
||||
$Pattern = read-host "Enter search pattern"
|
||||
}
|
||||
if ($Path -eq "" ) {
|
||||
$Path = read-host "Enter path to files"
|
||||
}
|
||||
|
||||
ListScripts $Pattern $Path | format-table -property Path,Line,Text
|
||||
exit 0
|
||||
} catch {
|
||||
|
Reference in New Issue
Block a user