Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small script fixes #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
24 changes: 18 additions & 6 deletions PauseIndexing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,29 @@ Param(

function ImportSQLModule
{
$moduleCheck = Get-Module -List SQLPS
$moduleCheck = Get-Module -List SQLSERVER
if($moduleCheck)
{
Import-Module -Name SQLPS -DisableNameChecking
Write-Host "Loaded SQLPS module..." -ForegroundColor Green
Import-Module -Name SQLSERVER -DisableNameChecking
Write-Host "Loaded SQLSERVER module..." -ForegroundColor Green
}
else
{
Write-Error "Cannot load module SQLPS. Please try from a machine running SQL Server 2012 or higher."
Pop-Location
exit
Write-Host "Cannot load module SQLSERVER. Trying to load SQLPS module." -ForegroundColor Yellow

$moduleCheck = Get-Module -List SQLPS

if($moduleCheck)
{
Import-Module -Name SQLPS -DisableNameChecking
Write-Host "Loaded SQLPS module..." -ForegroundColor Green
}
else
{
Write-Host "Cannot load SQLPS as well. Try running the script from a machine with SQL Server 2014 or higher installed or powershell 5.0" -ForegroundColor Red
Pop-Location
exit
}
}
}

Expand Down
24 changes: 18 additions & 6 deletions ResumeIndexing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,29 @@ function ResumeWorkItemIndexing

function ImportSQLModule
{
$moduleCheck = Get-Module -List SQLPS
$moduleCheck = Get-Module -List SQLSERVER
if($moduleCheck)
{
Import-Module -Name SQLPS -DisableNameChecking
Write-Host "Loaded SQLPS module..." -ForegroundColor Green
Import-Module -Name SQLSERVER -DisableNameChecking
Write-Host "Loaded SQLSERVER module..." -ForegroundColor Green
}
else
{
Write-Error "Cannot load module SQLPS. Please try from a machine running SQL Server 2012 or higher."
Pop-Location
exit
Write-Host "Cannot load module SQLSERVER. Trying to load SQLPS module." -ForegroundColor Yellow

$moduleCheck = Get-Module -List SQLPS

if($moduleCheck)
{
Import-Module -Name SQLPS -DisableNameChecking
Write-Host "Loaded SQLPS module..." -ForegroundColor Green
}
else
{
Write-Host "Cannot load SQLPS as well. Try running the script from a machine with SQL Server 2014 or higher installed or powershell 5.0" -ForegroundColor Red
Pop-Location
exit
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion TFS_2018RTW/ExtensionInstallIndexingStatus.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function CodeExtensionInstallIndexingStatus
}

# Gets the data for repositories which are still inprogress.
$SqlFullPath = Join-Path $PWD -ChildPath 'SqlScripts\CodeIndexingInProgressRepositoryCount.sql'
$SqlFullPath = Join-Path $PWD -ChildPath 'SqlScripts\CodeBulkIndexingInProgressRepositoryCount.sql'
$queryResults = Invoke-Sqlcmd -InputFile $SqlFullPath -serverInstance $SQLServerInstance -database $CollectionDatabaseName -Verbose -Variable $Params

if($queryResults.ItemArray.Count -gt 0)
Expand Down