Warning, /frameworks/syntax-highlighting/autotests/folding/craftenv.ps1.fold is written in an unsupported language. File is not indexed.
0001 <beginfold id='1'><#</beginfold id='1'>
0002 .SYNOPSIS
0003 Lorem ipsum dolor sit amet.
0004
0005 .DESCRIPTION
0006 Lorem ipsum dolor sit amet, consectetur adipiscing elit,
0007 sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
0008
0009 .PARAMETER InputPath
0010 Lorem ipsum dolor sit amet, consectetur adipiscing elit.
0011
0012 .parameter InputPath
0013 Lorem ipsum dolor sit amet, consectetur adipiscing elit.
0014
0015 bla .PARAMETER InputPath
0016 Lorem ipsum dolor sit amet, consectetur adipiscing elit.
0017
0018 .EXAMPLE
0019 PS> .\foo.ps1
0020 <endfold id='1'>#></endfold id='1'>
0021
0022 <beginfold id='2'>@"</beginfold id='2'> multi
0023 line
0024 string
0025 $x
0026 "'
0027 \n
0028 "@
0029 <endfold id='2'>"@</endfold id='2'>
0030
0031 <beginfold id='2'>@'</beginfold id='2'> multi
0032 line
0033 string
0034 $x
0035 "'
0036 \n
0037 '@
0038 <endfold id='2'>'@</endfold id='2'>
0039
0040 $foo = "Test `u{2013} String`nwith `"escapes`" """
0041 $foo = "Test `u{2013} String`nwith `"escapes`" `
0042 dssad"
0043 $foo = 'bla bla''bla bla $x `n'
0044 $Global:HOME = "abc"
0045
0046 [bool]::Parse('false')
0047
0048 echo [bool]::Parse('false')
0049 echo $env:EDITOR ${env:EDITOR} $foo ${foo} $foo-bar ${foo-bar} ${a b
0050 c}
0051 echo "hashtable: $(@<beginfold id='3'>{</beginfold id='3'> key = 'value' <endfold id='3'>}</endfold id='3'>)"
0052 echo 122.42kb 332.d 23d 625 3232e+2 0x233 0b1101
0053 echo 0xaj 0b1112 123a
0054
0055 docker run -dp 3000:3000 `
0056 -w /app -v "$(pwd):/app" `
0057 --network todo-app `
0058 -e MYSQL_HOST=mysql `
0059 -e MYSQL_USER=root `
0060 -e MYSQL_PASSWORD=secret `
0061 -e MYSQL_DB=todos `
0062 node:12-alpine `
0063 cmd "npm install && npm run start"
0064
0065
0066 function Get-NewPix
0067 <beginfold id='3'>{</beginfold id='3'>
0068 $start = Get-Date -Month 1 -Day 1 -Year 2010
0069 $allpix = Get-ChildItem -Path $env:UserProfile\*.jpg -Recurse
0070 $allpix | Where-Object <beginfold id='3'>{</beginfold id='3'>$_.LastWriteTime -gt $Start<endfold id='3'>}</endfold id='3'>
0071 <endfold id='3'>}</endfold id='3'>
0072
0073 function Get-SmallFiles <beginfold id='3'>{</beginfold id='3'>
0074 Param($Size)
0075 Get-ChildItem $HOME | Where-Object <beginfold id='3'>{</beginfold id='3'>
0076 $_.Length -lt $Size -and !$_.PSIsContainer
0077 <endfold id='3'>}</endfold id='3'>
0078 <endfold id='3'>}</endfold id='3'>
0079
0080 function Get-EscapedPath
0081 <beginfold id='3'>{</beginfold id='3'>
0082 param(
0083 [Parameter(
0084 Position=0,
0085 Mandatory=$true
0086 ValueFromPipeline=$true,
0087 ValueFromPipelineByPropertyName=$true)
0088 ]
0089 [string]$path
0090 )
0091
0092 process <beginfold id='3'>{</beginfold id='3'>
0093 if ($path.Contains(' '))
0094 <beginfold id='3'>{</beginfold id='3'>
0095 return '"' + $path + '"'
0096 <endfold id='3'>}</endfold id='3'>
0097 return $path
0098 <endfold id='3'>}</endfold id='3'>
0099 <endfold id='3'>}</endfold id='3'>
0100
0101 <beginfold id='1'><#</beginfold id='1'>
0102 Copied from Craft for testing syntax highlighting
0103 <endfold id='1'>#></endfold id='1'>
0104
0105 # this file sets some environment variables that are needed
0106 # for finding programs and libraries etc.
0107 # by Hannah von Reth <vonreth@kde.org>
0108 # you should copy kdesettings.ini to ..\etc\kdesettings.ini
0109 # and adapt it to your needs (see that file for more info)
0110
0111 # this file should contain all path settings - and provide thus an environment
0112 # to build and run kde programs
0113 # based on kdeenv.bat
0114
0115 cls
0116
0117
0118 $env:CraftRoot=[System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition)
0119
0120 $CRAFT_ARGUMENTS = $args
0121
0122 &<beginfold id='3'>{</beginfold id='3'>
0123 [version]$minPythonVersion = 3.6
0124
0125 function findPython([string] $name)
0126 <beginfold id='3'>{</beginfold id='3'>
0127 $py = (Get-Command $name -ErrorAction SilentlyContinue)
0128 if ($py -and ($py | Get-Member Version) -and $py.Version -ge $minPythonVersion) <beginfold id='3'>{</beginfold id='3'>
0129 $env:CRAFT_PYTHON=$py.Source
0130 <endfold id='3'>}</endfold id='3'>
0131 <endfold id='3'>}</endfold id='3'>
0132
0133 findPython("python3")
0134 findPython("python")
0135
0136 function readINI([string] $fileName)
0137 <beginfold id='3'>{</beginfold id='3'>
0138 $ini = @<beginfold id='3'>{</beginfold id='3'><endfold id='3'>}</endfold id='3'>
0139
0140 switch -regex -file $fileName <beginfold id='3'>{</beginfold id='3'>
0141 "^\[(.+)\]$" <beginfold id='3'>{</beginfold id='3'>
0142 $section = $matches[1].Trim()
0143 $ini[$section] = @<beginfold id='3'>{</beginfold id='3'><endfold id='3'>}</endfold id='3'>
0144 <endfold id='3'>}</endfold id='3'>
0145 "^\s*([^#].+?)\s*=\s*(.*)" <beginfold id='3'>{</beginfold id='3'>
0146 $name,$value = $matches[1..2]
0147 $ini[$section][$name] = $value.Trim()
0148 <endfold id='3'>}</endfold id='3'>
0149 <endfold id='3'>}</endfold id='3'>
0150 $ini
0151 <endfold id='3'>}</endfold id='3'>
0152
0153
0154
0155 if(test-path -path $env:CraftRoot\..\etc\kdesettings.ini)
0156 <beginfold id='3'>{</beginfold id='3'>
0157 $settings = readINI $env:CraftRoot\..\etc\kdesettings.ini
0158 <endfold id='3'>}</endfold id='3'>
0159 else
0160 <beginfold id='3'>{</beginfold id='3'>
0161 Write-Error("$env:CraftRoot\..\etc\kdesettings.ini Does not exist")
0162 break
0163 <endfold id='3'>}</endfold id='3'>
0164 if( $CRAFT_ARGUMENTS[0] -eq "--get")
0165 <beginfold id='3'>{</beginfold id='3'>
0166 Write-Host($settings[$CRAFT_ARGUMENTS[1]][$CRAFT_ARGUMENTS[2]])
0167 break
0168 <endfold id='3'>}</endfold id='3'>
0169
0170
0171 function prependPATH([string] $path)
0172 <beginfold id='3'>{</beginfold id='3'>
0173 $env:PATH="$path{0}$env:PATH" -f [IO.Path]::PathSeparator
0174 <endfold id='3'>}</endfold id='3'>
0175
0176 if( -Not $env:CRAFT_PYTHON)
0177 <beginfold id='3'>{</beginfold id='3'>
0178 prependPATH $settings["Paths"]["Python"]
0179 $env:CRAFT_PYTHON=[IO.PATH]::COMBINE($settings["Paths"]["Python"], "python")
0180 <endfold id='3'>}</endfold id='3'>
0181
0182 (& $env:CRAFT_PYTHON ([IO.PATH]::COMBINE("$env:CraftRoot", "bin", "CraftSetupHelper.py")) "--setup") |
0183 foreach <beginfold id='3'>{</beginfold id='3'>
0184 if ($_ -match "=") <beginfold id='3'>{</beginfold id='3'>
0185 $v = $_.split("=")
0186 set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
0187 #Write-Host("$v[0]=$v[1]")
0188 <endfold id='3'>}</endfold id='3'>
0189 <endfold id='3'>}</endfold id='3'>
0190
0191 cd "$env:KDEROOT"
0192 <endfold id='3'>}</endfold id='3'>
0193
0194
0195 function Global:craft() <beginfold id='3'>{</beginfold id='3'>
0196 return & $env:CRAFT_PYTHON ([IO.PATH]::COMBINE("$env:CraftRoot", "bin", "craft.py")) $args
0197 <endfold id='3'>}</endfold id='3'>
0198
0199
0200 if($args.Length -ne 0)
0201 <beginfold id='3'>{</beginfold id='3'>
0202 invoke-expression -command "$args"
0203 <endfold id='3'>}</endfold id='3'>