Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

powershell try catch connect-viserver

  try {
    Write-debug "Connecting to vCenter, please wait.."
    #Connect to vCenter
    Connect-ViServer -server $vcInfo.server -credential $creds -ErrorAction Stop | Out-Null
  }
  catch [Exception]{
    $status = 1
    $exception = $_.Exception
    Write-debug "Could not connect to vCenter"
    $msg = "Could not connect to vCenter"
    LogSysTo-File $msg $status $env:username $exception.message
  }
Comment

PREVIOUS NEXT
Code Example
Shell :: vbs on linux 
Shell :: bash if call function 
Shell :: motioneyeos terminal setup 
Shell :: select until end of file vim shortcut for commands 
Shell :: ADD GITHUB DEPLOY KEY curl 
Shell :: Err:15 http://ppa.launchpad.net/gnome-terminator/ppa/ubuntu bionic Release 404 Not Found [IP: 91.189.95.83 80] 
Shell :: goodix debug linux 
Shell :: groupadd to folder linux fedora 
Shell :: overwrite a file name character in linux 
Shell :: hwo to run a .bat file on a remote windows host 
Shell :: how to use uf 
Shell :: api uber eat node js 
Shell :: ubuntu switch between windows shortcut 
Shell :: powerrshell adobject get all deleted 
Shell :: git add interactively 
Shell :: how to open notepad with root using terminal in ubuntu 
Shell :: HPUX List Os Version 
Shell :: create folder putty linux 
Shell :: gcloud create cluster command 
Shell :: synology virtual machine install agent 
Shell :: E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/main/binary-arm64/Packages 404 Not Found [IP: 91.189.88.152 80] 
Shell :: install matlab on ubuntu 18.04 
Shell :: protect chrome passwords with a password in ubuntu 
Shell :: wasmtime 
Shell :: Recover files from deleted partition RHEL 6 USING testdisk 
Shell :: centos 8 gui 3 
Shell :: como agregar angular material al proyecto 
Shell :: how to install wordpress ubuntu 16.04 rosehosting 
Shell :: my numpad stopped working in ubuntu 
Shell :: mac vim freezin on .ts file 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =