src/New-CciSetupBat.ps1
function New-CciSetupBat { [CmdletBinding()] param ( $targetDir = 'C:\Users\Public\Desktop', $moduleName = 'cciplatformcustomizations' ) begin { Write-Verbose "$(Get-Date) : Started running $($MyInvocation.MyCommand)" } process { $bat = New-Item -Name "setup.bat" -Path $targetDir -ItemType File $bat | Add-Content "powershell -NoProfile -ExecutionPolicy Bypass -Command `"& {Start-Process powershell.exe -ArgumentList 'Set-ExecutionPolicy Bypass -Force; Get-cciModule -Name $($moduleName); Import-module c:\CCI\$($moduleName)\$($moduleName).psd1 -Force; Publish-CciCustomizationsBats' -Verb RunAs}`"" } end { Write-Verbose "$(Get-Date) : Finished running $($MyInvocation.MyCommand)" } } |