Skip to content

Commit b8048d7

Browse files
committed
🚨 fix: warnings with Write-Host and Write-Information
- Replaced `Write-Information` cmdlet to `Write-Host` cmdlet to resolve the compatibility issue with older versions of Powershell - Fixed the warning with `Write-Host` by using the `-f` format operator to concatenate the string and the variable These changes improve the performance and readability of the script.
1 parent a8f5a4d commit b8048d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

theBrain/Resize-TheBrainNotesYouTubeThumbnail.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Write-Host 'Scanning YouTube thumbnail URLs in Brain Notes...'
4545
$MatchInfo = Get-ChildItem -Path $SubFolders -Filter $Filename -Recurse | Select-String '\/(hq|maxres)default.jpg\)' -List
4646

4747
# For each matching result
48-
Write-Information 'Backing up and modifying Brain Notes...'
48+
Write-Host 'Backing up and modifying Brain Notes...'
4949
ForEach ($Match in $MatchInfo) {
5050
$FilePath = $Match.Path | Convert-Path # FilePath of the Notes.md file
5151
$ParentFolder = Split-Path -Path $FilePath -Parent # Path of the parent folder
@@ -62,7 +62,7 @@ ForEach ($Match in $MatchInfo) {
6262
Write-Verbose "Modified --> '$FilePath'"
6363
}
6464

65-
Write-Host 'Finished: ' $MatchInfo.Length 'file(s) found' # Output the number of files found
65+
Write-Host ('Finished: {0} file(s) found' -f $MatchInfo.Length) # Output the number of files found
6666

6767
$MatchInfo | Format-Table Path | Out-Host # Output the path of the files found
6868

0 commit comments

Comments
 (0)