added corrected things
This commit is contained in:
@@ -10,12 +10,12 @@ function Validate-Scripts {
|
|||||||
$ScriptWithoutShebangLine = @()
|
$ScriptWithoutShebangLine = @()
|
||||||
Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object {
|
Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object {
|
||||||
$relativePath = Resolve-Path $_.FullName -Relative
|
$relativePath = Resolve-Path $_.FullName -Relative
|
||||||
$shebangLine = Get-Content -Path $.FullName | Select-Object -First 1
|
$shebangLine = Get-Content -Path $_.FullName | Select-Object -First 1
|
||||||
if ($shebangLine -eq $ExpectedShebang) {
|
if ($shebangLine -eq $ExpectedShebang) {
|
||||||
Write-Host "[+] '$relativePath'"
|
Write-Host "[+] '$relativePath'"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-Host "[-] 'relativePath'"
|
Write-Host "[-] '$relativePath'"
|
||||||
$ScriptWithoutShebangLine += $relativePath
|
$ScriptWithoutShebangLine += $relativePath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user