Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ body:
placeholder: e.g. v1.1.1
validations:
required: true
- type: dropdown
id: pwsh_version
attributes:
label: PowerShell version
description: This can be found by running `$PSVersionTable` in PowerShell. If you don't see your version here, it's not supported.
options:
- '5.1'
- '6.x'
- '7.x'
validations:
required: true
- type: input
Expand Down
16 changes: 4 additions & 12 deletions .github/scripts/pssa-settings.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,16 @@
Enable = $true
# PowerShell platforms we want to check compatibility with
TargetProfiles = @(
'win-8_x64_10.0.14393.0_5.1.14393.2791_x64_4.0.30319.42000_framework', # PowerShell 5.1 on Windows Server 2016
'win-8_x64_10.0.17763.0_5.1.17763.316_x64_4.0.30319.42000_framework', # PowerShell 5.1 on Windows Server 2019
'win-48_x64_10.0.17763.0_5.1.17763.316_x64_4.0.30319.42000_framework'#, # PowerShell 5.1 on Windows 10
#'win-8_x64_10.0.14393.0_6.2.4_x64_4.0.30319.42000_core', # PowerShell 6.2 on Windows Server 2016
#'win-8_x64_10.0.17763.0_6.2.4_x64_4.0.30319.42000_core', # PowerShell 6.2 on Windows Server 2019
#'win-4_x64_10.0.18362.0_6.2.4_x64_4.0.30319.42000_core', # PowerShell 6.2 on Windows 10
#'win-8_x64_10.0.14393.0_7.0.0_x64_3.1.2_core', # PowerShell 7.0 on Windows Server 2016
#'win-8_x64_10.0.17763.0_7.0.0_x64_3.1.2_core', # PowerShell 7.0 on Server 2019
#'win-4_x64_10.0.18362.0_7.0.0_x64_3.1.2_core' # PowerShell 7.0 on Windows 10
'win-8_x64_10.0.14393.0_7.0.0_x64_3.1.2_core', # PowerShell 7.0 on Windows Server 2016
'win-8_x64_10.0.17763.0_7.0.0_x64_3.1.2_core', # PowerShell 7.0 on Server 2019
'win-4_x64_10.0.18362.0_7.0.0_x64_3.1.2_core' # PowerShell 7.0 on Windows 10
)
}
PSUseCompatibleSyntax = @{
Enable = $true
# PowerShell versions we want to check compatibility with
TargetVersions = @(
'5.1'#,
#'6.2',
#'7.1'
'7.0'
)
}
PSPlaceCloseBrace = @{
Expand Down
2 changes: 1 addition & 1 deletion Bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ $vbrSessionLogger.UpdateSuccess($vbrLogEntry, '[VeeamNotify] Parsed job & sessio
# Start a new new script in a new process with some of the information gathered here.
# This allows Veeam to finish the current session faster and allows us gather information from the completed job.
try {
$powershellExePath = (Get-Command -Name 'powershell.exe' -ErrorAction Stop).Path
$powershellExePath = (Get-Command -Name 'pwsh.exe' -ErrorAction Stop).Path
Write-LogMessage -Tag 'INFO' -Message 'Launching AlertSender.ps1...'
$vbrLogEntry = $vbrSessionLogger.AddLog('[VeeamNotify] Launching Alert Sender...')
Start-Process -FilePath "$powershellExePath" -Verb runAs -ArgumentList $powershellArguments -WindowStyle hidden -ErrorAction Stop
Expand Down
8 changes: 4 additions & 4 deletions Installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ function Get-InstallationSource {
# Query release stream
$releasePrompt = $true
$releaseTypePrompt = @{
Title = 'Release Selection'
Title = 'Release Selection'
Description = "Which release type would you like to install?`nLatest stable: $latestStable`nLatest prerelease: $latestPrerelease"
Default = 'Yes'
OptionAKey = 'Stable' ; OptionATitle = 'Install Latest Stable'
OptionBKey = 'Prerelease' ; OptionBTitle = 'Install Latest Prerelease'
Default = 'Yes'
OptionAKey = 'Stable' ; OptionATitle = 'Install Latest Stable'
OptionBKey = 'Prerelease' ; OptionBTitle = 'Install Latest Prerelease'
}
if (YesNoPrompt @releaseTypePrompt) {
$Latest = 'Release'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ As much relevant information as I've been able to discover from such backup sess
## Installation

Requirements:
* Veeam Backup & Replication 12 or higher.
* PowerShell 5.1 or higher.
* Veeam Backup & Replication 12 or higher
* PowerShell 7

Please see the [How to Install](https://github.com/tigattack/VeeamNotify/wiki/%F0%9F%94%A7-How-to-Install) wiki page.

Expand Down
2 changes: 1 addition & 1 deletion Updater.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ catch {
}

# Wait until the alert sender has finished running, or quit this if it's still running after 60s. It should never take that long.
while (Get-CimInstance win32_process -Filter "name='powershell.exe' and commandline like '%AlertSender.ps1%'") {
while (Get-CimInstance win32_process -Filter "name='pwsh.exe' and commandline like '%AlertSender.ps1%'") {
$timer++
Start-Sleep -Seconds 1
if ($timer -eq '90') {
Expand Down
10 changes: 5 additions & 5 deletions resources/DeployVeeamConfiguration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ function Update-JobWithFullPowershellPath {

try {
$jobOptions = $Job.GetOptions()
# Replace Powershell.exe with full path in a new variable for update.
$PostScriptFullPSPath = $PostScriptCmd -replace 'Powershell.exe', "$PowershellPath"
# Replace powershell.exe/pwsh.exe with full path in a new variable for update.
$PostScriptFullPSPath = $PostScriptCmd -replace 'powershell.exe', "$PowershellPath" -replace 'pwsh.exe', "$PowershellPath"
# Set job to use modified post script path
$jobOptions.JobScriptCommand.PostScriptCommandLine = $PostScriptFullPSPath
$null = Set-VeeamJobOptions -Job $Job -Options $jobOptions
Expand Down Expand Up @@ -217,8 +217,8 @@ function Set-BackupJobPostScript {

# Check if job is already configured for VeeamNotify
if ($postScriptCmd -eq $NewPostScriptCmd) {
# Check if job has full PowerShell.exe path
if ($postScriptCmd.StartsWith('powershell.exe', 'CurrentCultureIgnoreCase')) {
# Check if job has full powershell.exe/pwsh.exe path
if ($postScriptCmd.StartsWith('powershell.exe', 'CurrentCultureIgnoreCase') -or $postScriptCmd.StartsWith('pwsh.exe', 'CurrentCultureIgnoreCase')) {
return Update-JobWithFullPowershellPath -Job $Job -PowershellPath $PowershellPath -PostScriptCmd $postScriptCmd
}

Expand Down Expand Up @@ -308,7 +308,7 @@ function Start-JobConfiguration {

# Get PowerShell path
try {
$powershellExePath = (Get-Command -Name 'powershell.exe' -ErrorAction Stop).Path
$powershellExePath = (Get-Command -Name 'pwsh.exe' -ErrorAction Stop).Path
}
catch {
DeploymentError
Expand Down
10 changes: 5 additions & 5 deletions resources/NotificationBuilder.psm1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function New-Payload {
[CmdletBinding()]
[OutputType([PSCustomObject])]
[OutputType([Hashtable])]
param (
[Parameter(Mandatory)]
[ValidateSet('Discord', 'Slack', 'Teams', 'Telegram', 'HTTP')]
Expand Down Expand Up @@ -34,7 +34,7 @@ function New-Payload {

function New-DiscordPayload {
[CmdletBinding()]
[OutputType([PSCustomObject])]
[OutputType([Hashtable])]
param (
[string]$JobName,
[string]$JobType,
Expand Down Expand Up @@ -216,7 +216,7 @@ function New-DiscordPayload {

function New-TeamsPayload {
[CmdletBinding()]
[OutputType([PSCustomObject])]
[OutputType([Hashtable])]
param (
[string]$JobName,
[string]$JobType,
Expand Down Expand Up @@ -493,7 +493,7 @@ function New-TeamsPayload {

function New-SlackPayload {
[CmdletBinding()]
[OutputType([PSCustomObject])]
[OutputType([Hashtable])]
param (
[string]$JobName,
[string]$JobType,
Expand Down Expand Up @@ -688,7 +688,7 @@ function New-SlackPayload {

function New-TelegramPayload {
[CmdletBinding()]
[OutputType([PSCustomObject])]
[OutputType([Hashtable])]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSReviewUnusedParameter',
'ThumbnailUrl',
Expand Down
2 changes: 1 addition & 1 deletion resources/NotificationSender.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function Send-Payload {
$postParams = @{
Uri = $Uri
Method = $Method
UserAgent = "VeeamNotify; PowerShell/$psVersion"
UserAgent = "VeeamNotify (PowerShell/$psVersion)"
ErrorAction = 'Stop'
}

Expand Down
5 changes: 0 additions & 5 deletions tests/JsonValidator.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSUseCompatibleCommands',
'',
Justification = 'Pester tests are run in modern PowerShell'
)]
param ()

BeforeAll {
Expand Down
Loading