123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- param([string] $Name, [string] $ForcedPackages, [string] $Root = "$PSScriptRoot\automatic")
- if (Test-Path $PSScriptRoot/update_vars.ps1) { . $PSScriptRoot/update_vars.ps1 }
- $Options = [ordered]@{
- Timeout = 100
- UpdateTimeout = 1200
- Threads = 10
- Push = $Env:au_Push -eq 'true'
- PluginPath = ''
- Report = @{
- Type = 'markdown'
- Path = "$PSScriptRoot\Update-AUPackages.md"
- Params= @{
- Github_UserRepo = $Env:github_user_repo
- NoAppVeyor = $false
- UserMessage = "[History](#update-history)"
- NoIcons = $false
- IconSize = 32
- Title = ''
- }
- }
- History = @{
- Lines = 30
- Github_UserRepo = $Env:github_user_repo
- Path = "$PSScriptRoot\Update-History.md"
- }
- Gist = @{
- Id = $Env:gist_id
- ApiKey = $Env:github_api_key
- Path = "$PSScriptRoot\Update-AUPackages.md", "$PSScriptRoot\Update-History.md"
- }
- Git = @{
- User = ''
- Password = $Env:github_api_key
- }
- RunInfo = @{
- Exclude = 'password', 'apikey'
- Path = "$PSScriptRoot\update_info.xml"
- }
- Mail = if ($Env:mail_user) {
- @{
- To = $Env:mail_to
- From = $Env:mail_from
- Server = $Env:mail_server
- UserName = $Env:mail_user
- Password = $Env:mail_pass
- Port = $Env:mail_port
- EnableSsl = $Env:mail_enablessl -eq 'true'
- Attachment = "$PSScriptRoot\update_info.xml"
- UserMessage = ''
- SendAlways = $false
- }
- } else {}
- ForcedPackages = $ForcedPackages -split ' '
- BeforeEach = {
- param($PackageName, $Options )
- $p = $Options.ForcedPackages | Where-Object { $_ -match "^${PackageName}(?:\:(.+))*$" }
- if (!$p) { return }
- [Diagnostics.CodeAnalysis.SuppressMessageAttribute('UseDeclaredVarsMoreThanAssignments', '')]
- $global:au_Force = $true
- [Diagnostics.CodeAnalysis.SuppressMessageAttribute('UseDeclaredVarsMoreThanAssignments', '')]
- $global:au_Version = ($p -split ':')[1]
- }
- }
- [System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor
- 768 -bor
- [System.Net.SecurityProtocolType]::Tls -bor
- [System.Net.SecurityProtocolType]::Ssl3
- if ($ForcedPackages) { Write-Host "FORCED PACKAGES: $ForcedPackages" }
- $global:au_Root = $Root
- $global:info = updateall -Name $Name -Options $Options
|