Difference between revisions of "PowerShell"

From Torben's Wiki
(Created page with "get substring of string $var = 'Hello World' $result = $var.substring(0, 5) $result-> Hello merge that substring with another sting $dest = $rootPath + "\" +$subFolder...")
 
(No difference)

Latest revision as of 14:24, 4 November 2019

get substring of string

$var = 'Hello World'
$result = $var.substring(0, 5)
$result-> Hello

merge that substring with another sting

$dest = $rootPath + "\" +$subFolder

check a dir exists

if (Test-Path $dest) {
   Write-Host "We have the dir"
}

if not create

New-Item -ItemType directory -Path C:\tmp\newDir