Search notes:

Examples for the PowerShell module Rene.wsb

These are a few examples for the PowerShell module Rene.wsb.

Open explorer

start-wsb -logonCommand 'explorer.exe C:\Users\WDAGUtilityAccount'
Github repository ps-module-wsb, path: /examples/open-explorer.ps1

Run multiple commands

start-wsb -visiblePsCommand 'write-host "temp = $env:temp" -fo green; write-host "this is red" -fo red'
Github repository ps-module-wsb, path: /examples/multiple-commands.ps1

Disable the clipboard

set-clipboard -value 'This value was copied to the clipboard in the host.'
  start-wsb -disableClipboardRedirection -visiblePsCommand 'write-host (get-clipboard); set-clipboard -value "This value was copied to the clipboard in the sandbox."; read-host "Press any key to shutdown sandbox"; shutdown -s -t 0'
# start-wsb                              -visiblePsCommand 'write-host (get-clipboard); set-clipboard -value "This value was copied to the clipboard in the sandbox."; read-host "Press any key to shutdown sandbox"; shutdown -s -t 0'

while (-not (get-process WindowsSandboxClient -ea ignore)) {
 #
 # Wait until Sandbox is minimally started
 #
   start-sleep 1
}

while (get-process WindowsSandboxClient -ea ignore) {
 #
 # Wait until Sandbox is terminated
 #
   write-host (get-clipboard)
   start-sleep 1
}
Github repository ps-module-wsb, path: /examples/disable-clipboard.ps1

Run a Powershell script

start-wsb -psScript $psScriptRoot\the-script-to-be-run.ps1
Github repository ps-module-wsb, path: /examples/script/run-the-script.ps1

The script to be executed

write-host 'success' -fo green

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:51 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(51): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(66): id_of(Object(PDO), 'uri', '/notes/Windows/...') #2 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1788380345, '216.73.217.21', 'Mozilla/5.0 App...', NULL) #3 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/modules/personal/wsb/examples/index(83): insert_webrequest() #4 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 51