-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1880 from microsoft/bilong-vsstesterrefactor
Refactor VSSTester
- Loading branch information
Showing
23 changed files
with
621 additions
and
654 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,4 +158,5 @@ vuln | |
wbxml | ||
Webex | ||
Weve | ||
wevtutil | ||
windir |
This file was deleted.
Oops, something went wrong.
267 changes: 94 additions & 173 deletions
267
Databases/VSSTester/DiskShadow/Invoke-CreateDiskShadowFile.ps1
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
Databases/VSSTester/ExchangeInformation/Get-DbToBackup.ps1
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
function Get-VSSWriter { | ||
[CmdletBinding()] | ||
param () | ||
|
||
$writersText = vssadmin list writers | ||
if ($LASTEXITCODE) { | ||
Write-Warning $writersText | ||
throw "Unable to list vss writers" | ||
} | ||
|
||
for ($lineNumber = 3; $lineNumber -lt $writersText.Count; $lineNumber += 6) { | ||
[PSCustomObject]@{ | ||
Name = $writersText[$lineNumber].Substring($writersText[$lineNumber].IndexOf("'") + 1).TrimEnd("'") | ||
Id = $writersText[$lineNumber + 1].Substring($writersText[$lineNumber + 1].IndexOf("{") + 1).TrimEnd("}") | ||
InstanceId = $writersText[$lineNumber + 2].Substring($writersText[$lineNumber + 2].IndexOf("{") + 1).TrimEnd("}") | ||
State = $writersText[$lineNumber + 3].Substring($writersText[$lineNumber + 3].IndexOf(":") + 1).Trim() | ||
LastError = $writersText[$lineNumber + 4].Substring($writersText[$lineNumber + 4].IndexOf(":") + 1).Trim() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
. $PSScriptRoot\Get-VSSWriter.ps1 | ||
|
||
function Get-VSSWritersAfter { | ||
" " | ||
Get-Date | ||
Write-Host "Checking VSS Writer Status: (after backup)" -ForegroundColor Green $nl | ||
Write-Host "--------------------------------------------------------------------------------------------------------------" | ||
" " | ||
" " | ||
$writers = (vssadmin list writers) | ||
$writers > $path\vssWritersAfter.txt | ||
[OutputType([System.Void])] | ||
param( | ||
[Parameter(Mandatory = $true)] | ||
[string] | ||
$OutputPath | ||
) | ||
|
||
foreach ($line in $writers) { | ||
if ($line -like "Writer name:*") { | ||
"$line" | ||
} elseif ($line -like " State:*") { | ||
"$line" + $nl | ||
} | ||
} | ||
Write-Host "$(Get-Date) Checking VSS Writer Status: (after backup)" | ||
$writers = Get-VSSWriter | ||
$writers | Export-Csv $OutputPath\vssWritersAfter.csv -NoTypeInformation | ||
$writers | Sort-Object Name | Format-Table | Out-Host | ||
} |
Oops, something went wrong.