Remove the #!/usr/bin/pwsh line

This commit is contained in:
Markus Fleschutz
2021-04-21 19:53:52 +02:00
parent 7ab2795778
commit 450869a593
184 changed files with 108 additions and 344 deletions

View File

@ -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 {