Search notes:

PowerShell module filesystem, example: copy and modify files in a filesystem tree

set-strictMode -version latest
 
$src_root    = "$home/work/src"
$target_root = "$home/work/target"
 
$target_root = initialize-emptyDirectory  $target_root
if ($target_root -eq $null) {
 
    write-textInConsoleErrorColor "Could not remove $target_root"
    return
}
 
foreach ($file in get-childItem $src_root -recurse -include *.sql) {

    $fileRelPath = resolve-relativePath $src_root $file
    write-host $fileRelPath
 
    $content = get-content -raw -encoding default $file

    $content = $content -replace '[aeiou]', '#'
 
    write-file "$target_root$fileRelPath" $content ( [System.Text.Encoding]::GetEncoding(1252) )
}

See also

Powershell module: filesystem

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1758207170, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/modules/personal/filesystem/examples/copy-modify-files-in-filesystem-tree(57): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78