Skip to content
Open
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
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/

always-auth=true
always-auth=true
audit=false
12 changes: 10 additions & 2 deletions ci/check-powershell-syntax.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Description: Checks the PowerShell syntax of the script using PSScriptAnalyzer.
param([String]$pathToBuiltTasks)

$internalFeedUrl = "https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/powershell-modules/nuget/v2"
$internalRepoName = "AzDO-PSModules"

# Register internal Azure Artifacts feed as PS repository (avoids external network calls to PSGallery)
if (-Not (Get-PSRepository -Name $internalRepoName -ErrorAction SilentlyContinue)) {
Register-PSRepository -Name $internalRepoName -SourceLocation $internalFeedUrl -InstallationPolicy Trusted
}

function Get-AnalyzerSettings() {
return @{
Severity=@('Error', 'Warning', 'Information', 'ParseError', 'ParseWarning')
Expand Down Expand Up @@ -37,7 +45,7 @@ function Invoke-AnalyzerToTask() {
$module = Get-Module -Name "PSScriptAnalyzer";
if ($module -eq $null) {
Write-Host "Installing PSScriptAnalyzer module..."
Install-Module -Name "PSScriptAnalyzer" -Scope CurrentUser -Force
Install-Module -Name "PSScriptAnalyzer" -Scope CurrentUser -Force -Repository $internalRepoName
}

Write-Host "Running PSScriptAnalyzer for $taskPath."
Expand Down Expand Up @@ -106,7 +114,7 @@ function main() {
$module = Get-Module -Name "Newtonsoft.Json";
if ($module -eq $null) {
Write-Host "Installing Newtonsoft.Json module..."
Install-Module -Scope CurrentUser -Name "Newtonsoft.Json" -Force
Install-Module -Scope CurrentUser -Name "Newtonsoft.Json" -Force -Repository $internalRepoName
}

# Get the tasks which have a PowerShell handler.
Expand Down