gen_windows.ps1 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. #!powershell
  2. $ErrorActionPreference = "Stop"
  3. function amdGPUs {
  4. if ($env:AMDGPU_TARGETS) {
  5. return $env:AMDGPU_TARGETS
  6. }
  7. # TODO - load from some common data file for linux + windows build consistency
  8. $GPU_LIST = @(
  9. "gfx900"
  10. "gfx906:xnack-"
  11. "gfx908:xnack-"
  12. "gfx90a:xnack+"
  13. "gfx90a:xnack-"
  14. "gfx940"
  15. "gfx941"
  16. "gfx942"
  17. "gfx1010"
  18. "gfx1012"
  19. "gfx1030"
  20. "gfx1100"
  21. "gfx1101"
  22. "gfx1102"
  23. )
  24. $GPU_LIST -join ';'
  25. }
  26. function init_vars {
  27. if (!$script:SRC_DIR) {
  28. $script:SRC_DIR = $(resolve-path "..\..\")
  29. }
  30. if (!$script:llamacppDir) {
  31. $script:llamacppDir = "../llama.cpp"
  32. }
  33. if (!$script:cmakeTargets) {
  34. $script:cmakeTargets = @("ollama_llama_server")
  35. }
  36. $script:cmakeDefs = @(
  37. "-DBUILD_SHARED_LIBS=on",
  38. "-DGGML_NATIVE=off",
  39. "-DGGML_OPENMP=off"
  40. )
  41. $script:commonCpuDefs = @("-DCMAKE_POSITION_INDEPENDENT_CODE=on")
  42. $script:ARCH = $Env:PROCESSOR_ARCHITECTURE.ToLower()
  43. $script:DIST_BASE = "${script:SRC_DIR}\dist\windows-${script:ARCH}\ollama_runners"
  44. md "$script:DIST_BASE" -ea 0 > $null
  45. if ($env:CGO_CFLAGS -contains "-g") {
  46. $script:cmakeDefs += @("-DCMAKE_VERBOSE_MAKEFILE=on", "-DLLAMA_SERVER_VERBOSE=on", "-DCMAKE_BUILD_TYPE=RelWithDebInfo")
  47. $script:config = "RelWithDebInfo"
  48. } else {
  49. $script:cmakeDefs += @("-DLLAMA_SERVER_VERBOSE=off", "-DCMAKE_BUILD_TYPE=Release")
  50. $script:config = "Release"
  51. }
  52. if ($null -ne $env:CMAKE_SYSTEM_VERSION) {
  53. $script:cmakeDefs += @("-DCMAKE_SYSTEM_VERSION=${env:CMAKE_SYSTEM_VERSION}")
  54. }
  55. # Try to find the CUDA dir
  56. if ($env:CUDA_LIB_DIR -eq $null) {
  57. $d=(get-command -ea 'silentlycontinue' nvcc).path
  58. if ($d -ne $null) {
  59. $script:CUDA_LIB_DIR=($d| split-path -parent)
  60. $script:CUDA_INCLUDE_DIR=($script:CUDA_LIB_DIR|split-path -parent)+"\include"
  61. }
  62. } else {
  63. $script:CUDA_LIB_DIR=$env:CUDA_LIB_DIR
  64. }
  65. $script:DUMPBIN=(get-command -ea 'silentlycontinue' dumpbin).path
  66. if ($null -eq $env:CMAKE_CUDA_ARCHITECTURES) {
  67. $script:CMAKE_CUDA_ARCHITECTURES="50;52;61;70;75;80"
  68. } else {
  69. $script:CMAKE_CUDA_ARCHITECTURES=$env:CMAKE_CUDA_ARCHITECTURES
  70. }
  71. # Note: Windows Kits 10 signtool crashes with GCP's plugin
  72. if ($null -eq $env:SIGN_TOOL) {
  73. ${script:SignTool}="C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe"
  74. } else {
  75. ${script:SignTool}=${env:SIGN_TOOL}
  76. }
  77. if ("${env:KEY_CONTAINER}") {
  78. ${script:OLLAMA_CERT}=$(resolve-path "${script:SRC_DIR}\ollama_inc.crt")
  79. }
  80. }
  81. function git_module_setup {
  82. # TODO add flags to skip the init/patch logic to make it easier to mod llama.cpp code in-repo
  83. & git submodule init
  84. if ($LASTEXITCODE -ne 0) { exit($LASTEXITCODE)}
  85. & git submodule update --force "${script:llamacppDir}"
  86. if ($LASTEXITCODE -ne 0) { exit($LASTEXITCODE)}
  87. }
  88. function apply_patches {
  89. # Wire up our CMakefile
  90. if (!(Select-String -Path "${script:llamacppDir}/CMakeLists.txt" -Pattern 'ollama')) {
  91. Add-Content -Path "${script:llamacppDir}/CMakeLists.txt" -Value 'add_subdirectory(../ext_server ext_server) # ollama'
  92. }
  93. # Apply temporary patches until fix is upstream
  94. $patches = Get-ChildItem "../patches/*.diff"
  95. foreach ($patch in $patches) {
  96. # Extract file paths from the patch file
  97. $filePaths = Get-Content $patch.FullName | Where-Object { $_ -match '^\+\+\+ ' } | ForEach-Object {
  98. $parts = $_ -split ' '
  99. ($parts[1] -split '/', 2)[1]
  100. }
  101. # Checkout each file
  102. foreach ($file in $filePaths) {
  103. git -C "${script:llamacppDir}" checkout $file
  104. }
  105. }
  106. # Apply each patch
  107. foreach ($patch in $patches) {
  108. git -C "${script:llamacppDir}" apply $patch.FullName
  109. }
  110. }
  111. function build {
  112. write-host "generating config with: cmake -S ${script:llamacppDir} -B $script:buildDir $script:cmakeDefs"
  113. & cmake --version
  114. & cmake -S "${script:llamacppDir}" -B $script:buildDir $script:cmakeDefs
  115. if ($LASTEXITCODE -ne 0) { exit($LASTEXITCODE)}
  116. if ($cmakeDefs -contains "-G") {
  117. $extra=@("-j8")
  118. } else {
  119. $extra= @("--", "/p:CL_MPcount=8")
  120. }
  121. write-host "building with: cmake --build $script:buildDir --config $script:config $($script:cmakeTargets | ForEach-Object { `"--target`", $_ }) $extra"
  122. & cmake --build $script:buildDir --config $script:config ($script:cmakeTargets | ForEach-Object { "--target", $_ }) $extra
  123. if ($LASTEXITCODE -ne 0) { exit($LASTEXITCODE)}
  124. # Rearrange output to be consistent between different generators
  125. if ($null -ne ${script:config} -And (test-path -path "${script:buildDir}/bin/${script:config}" ) ) {
  126. mv -force "${script:buildDir}/bin/${script:config}/*" "${script:buildDir}/bin/"
  127. remove-item "${script:buildDir}/bin/${script:config}"
  128. }
  129. }
  130. function sign {
  131. if ("${env:KEY_CONTAINER}") {
  132. write-host "Signing ${script:buildDir}/bin/*.exe ${script:buildDir}/bin/*.dll"
  133. foreach ($file in @(get-childitem "${script:buildDir}/bin/*.exe") + @(get-childitem "${script:buildDir}/bin/*.dll")){
  134. & "${script:SignTool}" sign /v /fd sha256 /t http://timestamp.digicert.com /f "${script:OLLAMA_CERT}" `
  135. /csp "Google Cloud KMS Provider" /kc "${env:KEY_CONTAINER}" $file
  136. if ($LASTEXITCODE -ne 0) { exit($LASTEXITCODE)}
  137. }
  138. }
  139. }
  140. function install {
  141. write-host "Installing binaries to dist dir ${script:distDir}"
  142. mkdir ${script:distDir} -ErrorAction SilentlyContinue
  143. $binaries = dir "${script:buildDir}/bin/*.exe"
  144. foreach ($file in $binaries) {
  145. copy-item -Path $file -Destination ${script:distDir} -Force
  146. }
  147. write-host "Installing dlls to dist dir ${script:distDir}"
  148. $dlls = dir "${script:buildDir}/bin/*.dll"
  149. foreach ($file in $dlls) {
  150. copy-item -Path $file -Destination ${script:distDir} -Force
  151. }
  152. }
  153. function cleanup {
  154. $patches = Get-ChildItem "../patches/*.diff"
  155. foreach ($patch in $patches) {
  156. # Extract file paths from the patch file
  157. $filePaths = Get-Content $patch.FullName | Where-Object { $_ -match '^\+\+\+ ' } | ForEach-Object {
  158. $parts = $_ -split ' '
  159. ($parts[1] -split '/', 2)[1]
  160. }
  161. # Checkout each file
  162. foreach ($file in $filePaths) {
  163. git -C "${script:llamacppDir}" checkout $file
  164. }
  165. git -C "${script:llamacppDir}" checkout CMakeLists.txt
  166. }
  167. }
  168. # -DGGML_AVX -- 2011 Intel Sandy Bridge & AMD Bulldozer
  169. # -DGGML_AVX2 -- 2013 Intel Haswell & 2015 AMD Excavator / 2017 AMD Zen
  170. # -DGGML_FMA (FMA3) -- 2013 Intel Haswell & 2012 AMD Piledriver
  171. function build_static() {
  172. if ((-not "${env:OLLAMA_SKIP_STATIC_GENERATE}") -and ((-not "${env:OLLAMA_CPU_TARGET}") -or ("${env:OLLAMA_CPU_TARGET}" -eq "static"))) {
  173. # GCC build for direct linking into the Go binary
  174. init_vars
  175. # cmake will silently fallback to msvc compilers if mingw isn't in the path, so detect and fail fast
  176. # as we need this to be compiled by gcc for golang to be able to link with itx
  177. write-host "Checking for MinGW..."
  178. # error action ensures we exit on failure
  179. get-command gcc
  180. get-command mingw32-make
  181. $oldTargets = $script:cmakeTargets
  182. $script:cmakeTargets = @("llama", "ggml")
  183. $script:cmakeDefs = @(
  184. "-G", "MinGW Makefiles"
  185. "-DCMAKE_C_COMPILER=gcc.exe",
  186. "-DCMAKE_CXX_COMPILER=g++.exe",
  187. "-DBUILD_SHARED_LIBS=off",
  188. "-DGGML_NATIVE=off",
  189. "-DGGML_AVX=off",
  190. "-DGGML_AVX2=off",
  191. "-DGGML_AVX512=off",
  192. "-DGGML_F16C=off",
  193. "-DGGML_FMA=off",
  194. "-DGGML_OPENMP=off")
  195. $script:buildDir="../build/windows/${script:ARCH}_static"
  196. write-host "Building static library"
  197. build
  198. $script:cmakeTargets = $oldTargets
  199. } else {
  200. write-host "Skipping CPU generation step as requested"
  201. }
  202. }
  203. function build_cpu($gen_arch) {
  204. if ((-not "${env:OLLAMA_SKIP_CPU_GENERATE}" ) -and ((-not "${env:OLLAMA_CPU_TARGET}") -or ("${env:OLLAMA_CPU_TARGET}" -eq "cpu"))) {
  205. # remaining llama.cpp builds use MSVC
  206. init_vars
  207. $script:cmakeDefs = $script:commonCpuDefs + @("-A", $gen_arch, "-DGGML_AVX=off", "-DGGML_AVX2=off", "-DGGML_AVX512=off", "-DGGML_FMA=off", "-DGGML_F16C=off") + $script:cmakeDefs
  208. $script:buildDir="../build/windows/${script:ARCH}/cpu"
  209. $script:distDir="$script:DIST_BASE\cpu"
  210. write-host "Building LCD CPU"
  211. build
  212. sign
  213. install
  214. } else {
  215. write-host "Skipping CPU generation step as requested"
  216. }
  217. }
  218. function build_cpu_avx() {
  219. if ((-not "${env:OLLAMA_SKIP_CPU_GENERATE}" ) -and ((-not "${env:OLLAMA_CPU_TARGET}") -or ("${env:OLLAMA_CPU_TARGET}" -eq "cpu_avx"))) {
  220. init_vars
  221. $script:cmakeDefs = $script:commonCpuDefs + @("-A", "x64", "-DGGML_AVX=on", "-DGGML_AVX2=off", "-DGGML_AVX512=off", "-DGGML_FMA=off", "-DGGML_F16C=off") + $script:cmakeDefs
  222. $script:buildDir="../build/windows/${script:ARCH}/cpu_avx"
  223. $script:distDir="$script:DIST_BASE\cpu_avx"
  224. write-host "Building AVX CPU"
  225. build
  226. sign
  227. install
  228. } else {
  229. write-host "Skipping CPU AVX generation step as requested"
  230. }
  231. }
  232. function build_cpu_avx2() {
  233. if ((-not "${env:OLLAMA_SKIP_CPU_GENERATE}" ) -and ((-not "${env:OLLAMA_CPU_TARGET}") -or ("${env:OLLAMA_CPU_TARGET}" -eq "cpu_avx2"))) {
  234. init_vars
  235. $script:cmakeDefs = $script:commonCpuDefs + @("-A", "x64", "-DGGML_AVX=on", "-DGGML_AVX2=on", "-DGGML_AVX512=off", "-DGGML_FMA=on", "-DGGML_F16C=on") + $script:cmakeDefs
  236. $script:buildDir="../build/windows/${script:ARCH}/cpu_avx2"
  237. $script:distDir="$script:DIST_BASE\cpu_avx2"
  238. write-host "Building AVX2 CPU"
  239. build
  240. sign
  241. install
  242. } else {
  243. write-host "Skipping CPU AVX2 generation step as requested"
  244. }
  245. }
  246. function build_cuda() {
  247. if ((-not "${env:OLLAMA_SKIP_CUDA_GENERATE}") -and ("${script:CUDA_LIB_DIR}")) {
  248. # Then build cuda as a dynamically loaded library
  249. $nvcc = "$script:CUDA_LIB_DIR\nvcc.exe"
  250. $script:CUDA_VERSION=(get-item ($nvcc | split-path | split-path)).Basename
  251. if ($null -ne $script:CUDA_VERSION) {
  252. $script:CUDA_VARIANT="_"+$script:CUDA_VERSION
  253. }
  254. init_vars
  255. $script:buildDir="../build/windows/${script:ARCH}/cuda$script:CUDA_VARIANT"
  256. $script:distDir="$script:DIST_BASE\cuda$script:CUDA_VARIANT"
  257. $script:cmakeDefs += @(
  258. "-A", "x64",
  259. "-DGGML_CUDA=ON",
  260. "-DGGML_AVX=on",
  261. "-DGGML_AVX2=off",
  262. "-DCUDAToolkit_INCLUDE_DIR=$script:CUDA_INCLUDE_DIR",
  263. "-DCMAKE_CUDA_FLAGS=-t8",
  264. "-DCMAKE_CUDA_ARCHITECTURES=${script:CMAKE_CUDA_ARCHITECTURES}"
  265. )
  266. if ($null -ne $env:OLLAMA_CUSTOM_CUDA_DEFS) {
  267. write-host "OLLAMA_CUSTOM_CUDA_DEFS=`"${env:OLLAMA_CUSTOM_CUDA_DEFS}`""
  268. $script:cmakeDefs +=@("${env:OLLAMA_CUSTOM_CUDA_DEFS}")
  269. write-host "building custom CUDA GPU"
  270. }
  271. build
  272. sign
  273. install
  274. rm -ea 0 -recurse -force -path "${script:SRC_DIR}\dist\windows-${script:ARCH}\cuda\"
  275. md "${script:SRC_DIR}\dist\windows-${script:ARCH}\cuda\" -ea 0 > $null
  276. write-host "copying CUDA dependencies to ${script:SRC_DIR}\dist\windows-${script:ARCH}\cuda\"
  277. cp "${script:CUDA_LIB_DIR}\cudart64_*.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\cuda\"
  278. cp "${script:CUDA_LIB_DIR}\cublas64_*.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\cuda\"
  279. cp "${script:CUDA_LIB_DIR}\cublasLt64_*.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\cuda\"
  280. } else {
  281. write-host "Skipping CUDA generation step"
  282. }
  283. }
  284. function build_oneapi() {
  285. if ((-not "${env:OLLAMA_SKIP_ONEAPI_GENERATE}") -and ("${env:ONEAPI_ROOT}")) {
  286. # Get oneAPI version
  287. $script:ONEAPI_VERSION = icpx --version
  288. $script:ONEAPI_VERSION = [regex]::Match($script:ONEAPI_VERSION, '(?<=oneAPI DPC\+\+/C\+\+ Compiler )(?<version>\d+\.\d+\.\d+)').Value
  289. if ($null -ne $script:ONEAPI_VERSION) {
  290. $script:ONEAPI_VARIANT = "_v" + $script:ONEAPI_VERSION
  291. }
  292. init_vars
  293. $script:buildDir = "../build/windows/${script:ARCH}/oneapi$script:ONEAPI_VARIANT"
  294. $script:distDir ="$script:DIST_BASE\oneapi$script:ONEAPI_VARIANT"
  295. $script:cmakeDefs += @(
  296. "-G", "MinGW Makefiles",
  297. "-DGGML_SYCL=ON",
  298. "-DCMAKE_C_COMPILER=icx",
  299. "-DCMAKE_CXX_COMPILER=icx",
  300. "-DCMAKE_BUILD_TYPE=Release"
  301. )
  302. Write-Host "Building oneAPI"
  303. build
  304. # Ninja doesn't prefix with config name
  305. if ($null -ne $script:DUMPBIN) {
  306. & "$script:DUMPBIN" /dependents "${script:buildDir}/bin/ollama_llama_server.exe" | Select-String ".dll"
  307. }
  308. sign
  309. install
  310. rm -ea 0 -recurse -force -path "${script:SRC_DIR}\dist\windows-${script:ARCH}\oneapi\"
  311. md "${script:SRC_DIR}\dist\windows-${script:ARCH}\oneapi\" -ea 0 > $null
  312. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\libirngmd.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\oneapi\"
  313. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\libmmd.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\oneapi\"
  314. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\pi_level_zero.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\oneapi\"
  315. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\pi_unified_runtime.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\oneapi\"
  316. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\pi_win_proxy_loader.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\oneapi\"
  317. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\svml_dispmd.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\oneapi\"
  318. cp "${env:ONEAPI_ROOT}\compiler\latest\bin\sycl7.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\oneapi\"
  319. cp "${env:ONEAPI_ROOT}\mkl\latest\bin\mkl_core.2.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\oneapi\"
  320. cp "${env:ONEAPI_ROOT}\mkl\latest\bin\mkl_sycl_blas.4.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\oneapi\"
  321. cp "${env:ONEAPI_ROOT}\mkl\latest\bin\mkl_tbb_thread.2.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\oneapi\"
  322. } else {
  323. Write-Host "Skipping oneAPI generation step"
  324. }
  325. }
  326. function build_rocm() {
  327. if ((-not "${env:OLLAMA_SKIP_ROCM_GENERATE}") -and ("${env:HIP_PATH}")) {
  328. $script:ROCM_VERSION=(get-item $env:HIP_PATH).Basename
  329. if ($null -ne $script:ROCM_VERSION) {
  330. $script:ROCM_VARIANT="_v"+$script:ROCM_VERSION
  331. }
  332. init_vars
  333. $script:buildDir="../build/windows/${script:ARCH}/rocm$script:ROCM_VARIANT"
  334. $script:distDir="$script:DIST_BASE\rocm$script:ROCM_VARIANT"
  335. $script:cmakeDefs += @(
  336. "-G", "Ninja",
  337. "-DCMAKE_C_COMPILER=clang.exe",
  338. "-DCMAKE_CXX_COMPILER=clang++.exe",
  339. "-DGGML_HIPBLAS=on",
  340. "-DHIP_PLATFORM=amd",
  341. "-DGGML_AVX=on",
  342. "-DGGML_AVX2=off",
  343. "-DCMAKE_POSITION_INDEPENDENT_CODE=on",
  344. "-DAMDGPU_TARGETS=$(amdGPUs)",
  345. "-DGPU_TARGETS=$(amdGPUs)"
  346. )
  347. # Make sure the ROCm binary dir is first in the path
  348. $env:PATH="$env:HIP_PATH\bin;$env:PATH"
  349. # We have to clobber the LIB var from the developer shell for clang to work properly
  350. $env:LIB=""
  351. if ($null -ne $env:OLLAMA_CUSTOM_ROCM_DEFS) {
  352. write-host "OLLAMA_CUSTOM_ROCM_DEFS=`"${env:OLLAMA_CUSTOM_ROCM_DEFS}`""
  353. $script:cmakeDefs += @("${env:OLLAMA_CUSTOM_ROCM_DEFS}")
  354. write-host "building custom ROCM GPU"
  355. }
  356. write-host "Building ROCm"
  357. build
  358. # Ninja doesn't prefix with config name
  359. ${script:config}=""
  360. if ($null -ne $script:DUMPBIN) {
  361. & "$script:DUMPBIN" /dependents "${script:buildDir}/bin/ollama_llama_server.exe" | select-string ".dll"
  362. }
  363. sign
  364. install
  365. # Assumes v5.7, may need adjustments for v6
  366. rm -ea 0 -recurse -force -path "${script:SRC_DIR}\dist\windows-${script:ARCH}\rocm\"
  367. md "${script:SRC_DIR}\dist\windows-${script:ARCH}\rocm\rocblas\library\" -ea 0 > $null
  368. cp "${env:HIP_PATH}\bin\hipblas.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\rocm\"
  369. cp "${env:HIP_PATH}\bin\rocblas.dll" "${script:SRC_DIR}\dist\windows-${script:ARCH}\rocm\"
  370. # amdhip64.dll dependency comes from the driver and must be installed on the host to use AMD GPUs
  371. cp "${env:HIP_PATH}\bin\rocblas\library\*" "${script:SRC_DIR}\dist\windows-${script:ARCH}\rocm\rocblas\library\"
  372. } else {
  373. write-host "Skipping ROCm generation step"
  374. }
  375. }
  376. init_vars
  377. if ($($args.count) -eq 0) {
  378. git_module_setup
  379. apply_patches
  380. build_static
  381. if ($script:ARCH -eq "arm64") {
  382. build_cpu("ARM64")
  383. } else { # amd64
  384. build_cpu("x64")
  385. build_cpu_avx
  386. build_cpu_avx2
  387. build_cuda
  388. build_oneapi
  389. build_rocm
  390. }
  391. cleanup
  392. write-host "`ngo generate completed. LLM runners: $(get-childitem -path $script:DIST_BASE)"
  393. } else {
  394. for ( $i = 0; $i -lt $args.count; $i++ ) {
  395. write-host "performing $($args[$i])"
  396. & $($args[$i])
  397. }
  398. }