forked from DeploymentBunny/Files
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
adefdc3
commit 465afd4
Showing
8 changed files
with
809 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<# | ||
################################################################################## | ||
# Script name: DownloadAll.ps1 | ||
# Created: 2012-12-26 | ||
# version: v1.0 | ||
# Author: Mikael Nystrom | ||
# Homepage: http://deploymentbunny.com/ | ||
################################################################################## | ||
################################################################################## | ||
# Disclaimer: | ||
# ----------- | ||
# This script is provided "AS IS" with no warranties, confers no rights and | ||
# is not supported by the authors or DeploymentBunny. | ||
################################################################################## | ||
#> | ||
Param( | ||
[Parameter(mandatory=$false,HelpMessage="Name and path of XML file")] | ||
[ValidateNotNullOrEmpty()] | ||
$DownloadFile = '.\download.xml', | ||
|
||
[Parameter(mandatory=$False,HelpMessage="Name and path of download folder")] | ||
[ValidateNotNullOrEmpty()] | ||
$DownloadFolder = 'C:\Downloads' | ||
) | ||
Function Logit() | ||
{ | ||
$TextBlock1 = $args[0] | ||
$TextBlock2 = $args[1] | ||
$TextBlock3 = $args[2] | ||
$Stamp = Get-Date | ||
Write-Host "[$Stamp] [$Section - $TextBlock1]" | ||
} | ||
|
||
# Main | ||
$Section = "Main" | ||
Logit "DownLoadFolder - $DownLoadFolder" | ||
Logit "DownloadFile - $DownloadFile" | ||
|
||
#Read content | ||
$Section = "Reading datafile" | ||
Logit "Reading from $DownloadFile" | ||
[xml]$Data = Get-Content $DownloadFile | ||
$TotalNumberOfObjects = $Data.Download.DownloadItem.Count | ||
|
||
# Start downloading | ||
$Section = "Downloading" | ||
Logit "Downloading $TotalNumberOfObjects objects" | ||
$Count = (0) | ||
foreach($DataRecord in $Data.Download.DownloadItem) | ||
{ | ||
$FullName = $DataRecord.FullName | ||
$Count = ($Count + 1) | ||
$Source = $DataRecord.Source | ||
$DestinationFolder = $DataRecord.DestinationFolder | ||
$DestinationFile = $DataRecord.DestinationFile | ||
Logit "Working on $FullName ($Count/$TotalNumberOfObjects)" | ||
$DestinationFolder = $DownloadFolder + "\" + $DestinationFolder | ||
$Destination = $DestinationFolder + "\" + $DestinationFile | ||
$Downloaded = Test-Path $Destination | ||
if($Downloaded -like 'True'){} | ||
else | ||
{ | ||
Logit "$DestinationFile needs to be downloaded." | ||
Logit "Creating $DestinationFolder" | ||
New-Item -Path $DestinationFolder -ItemType Directory -Force | Out-Null | ||
Logit "Downloading $Destination" | ||
Try | ||
{ | ||
Start-BitsTransfer -Destination $Destination -Source $Source -Description "Download $FullName" -ErrorAction Continue | ||
} | ||
Catch | ||
{ | ||
$ErrorMessage = $_.Exception.Message | ||
Logit "Fail: $ErrorMessage" | ||
} | ||
} | ||
} | ||
|
||
# Start Proccessing downloaded files | ||
$Section = "Process files" | ||
Logit "Checking $TotalNumberOfObjects objects" | ||
$Count = (0) | ||
foreach($DataRecord in $Data.Download.DownloadItem){ | ||
$CommandType = $DataRecord.CommandType | ||
if($CommandType -like 'NONE') | ||
{} | ||
else | ||
{ | ||
$FullName = $DataRecord.FullName | ||
$Count = ($Count + 1) | ||
$Source = $DataRecord.Source | ||
$Command = $DataRecord.Command | ||
$CommandLineSwitches = $DataRecord.CommandLineSwitches | ||
$VerifyAfterCommand = $DataRecord.VerifyAfterCommand | ||
$DestinationFolder = $DataRecord.DestinationFolder | ||
$DestinationFile = $DataRecord.DestinationFile | ||
$DestinationFolder = $DownLoadFolder + "\" + $DestinationFolder | ||
$Destination = $DestinationFolder + "\" + $DestinationFile | ||
$CheckFile = $DestinationFolder + "\" + $VerifyAfterCommand | ||
Logit "Working on $FullName ($Count/$TotalNumberOfObjects)" | ||
Logit "Looking for $CheckFile" | ||
$CommandDone = Test-Path $CheckFile | ||
if($CommandDone -like 'True') | ||
{ | ||
Logit "$FullName is already done" | ||
} | ||
else | ||
{ | ||
Logit "$FullName needs to be fixed." | ||
#Selecting correct method to extract data | ||
Switch($CommandType){ | ||
EXEType01{ | ||
$Command = $DestinationFolder + "\" + $Command | ||
$DownLoadProcess = Start-Process """$Command""" -ArgumentList ($CommandLineSwitches + " " + """$DestinationFolder""") -Wait | ||
$DownLoadProcess.HasExited | ||
$DownLoadProcess.ExitCode | ||
} | ||
NONE{ | ||
} | ||
default{ | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Done | ||
$Section = "Finish" | ||
Logit "All Done" |
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 @@ | ||
C:\Setup\Files\Tools\Get-AllC++Runtimes\Get-Downloads.ps1 -DownloadFile C:\Setup\Files\Tools\Get-AllC++Runtimes\download.xml –DownloadFolder 'C:\Setup\DL' |
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,158 @@ | ||
<Download> | ||
<DownloadItem> | ||
<Comment></Comment> | ||
<FullName>Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)</FullName> | ||
<ShortName>VS2005X86SP1</ShortName> | ||
<Source>http://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x86.EXE</Source> | ||
<DestinationFolder>VS2005</DestinationFolder> | ||
<DestinationFile>vcredist_x86.exe</DestinationFile> | ||
<URL>http://www.microsoft.com</URL> | ||
<CommandType>NONE</CommandType> | ||
<Command></Command> | ||
<CommandLineSwitches></CommandLineSwitches> | ||
<VerifyAfterCommand></VerifyAfterCommand> | ||
</DownloadItem> | ||
<DownloadItem> | ||
<Comment></Comment> | ||
<FullName>Microsoft Visual C++ 2005 SP1 Redistributable Package (x64)</FullName> | ||
<ShortName>VS2005X64SP1</ShortName> | ||
<Source>http://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x64.EXE</Source> | ||
<DestinationFolder>VS2005</DestinationFolder> | ||
<DestinationFile>vcredist_x64.exe</DestinationFile> | ||
<URL>http://www.microsoft.com</URL> | ||
<CommandType>NONE</CommandType> | ||
<Command></Command> | ||
<CommandLineSwitches></CommandLineSwitches> | ||
<VerifyAfterCommand></VerifyAfterCommand> | ||
</DownloadItem> | ||
<DownloadItem> | ||
<Comment></Comment> | ||
<FullName>Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)</FullName> | ||
<ShortName>VS2008X86SP1</ShortName> | ||
<Source>http://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe</Source> | ||
<DestinationFolder>VS2008</DestinationFolder> | ||
<DestinationFile>vcredist_x86.exe</DestinationFile> | ||
<URL>http://www.microsoft.com</URL> | ||
<CommandType>NONE</CommandType> | ||
<Command></Command> | ||
<CommandLineSwitches></CommandLineSwitches> | ||
<VerifyAfterCommand></VerifyAfterCommand> | ||
</DownloadItem> | ||
<DownloadItem> | ||
<Comment></Comment> | ||
<FullName>Microsoft Visual C++ 2008 SP1 Redistributable Package (x64)</FullName> | ||
<ShortName>VS2008X64SP1</ShortName> | ||
<Source>http://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x64.exe</Source> | ||
<DestinationFolder>VS2008</DestinationFolder> | ||
<DestinationFile>vcredist_x64.exe</DestinationFile> | ||
<URL>http://www.microsoft.com</URL> | ||
<CommandType>NONE</CommandType> | ||
<Command></Command> | ||
<CommandLineSwitches></CommandLineSwitches> | ||
<VerifyAfterCommand></VerifyAfterCommand> | ||
</DownloadItem> | ||
<DownloadItem> | ||
<Comment></Comment> | ||
<FullName>Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)</FullName> | ||
<ShortName>VS2010X86SP1</ShortName> | ||
<Source>http://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe</Source> | ||
<DestinationFolder>VS2010</DestinationFolder> | ||
<DestinationFile>vcredist_x86.exe</DestinationFile> | ||
<URL>http://www.microsoft.com</URL> | ||
<CommandType>NONE</CommandType> | ||
<Command></Command> | ||
<CommandLineSwitches></CommandLineSwitches> | ||
<VerifyAfterCommand></VerifyAfterCommand> | ||
</DownloadItem> | ||
<DownloadItem> | ||
<Comment></Comment> | ||
<FullName>Microsoft Visual C++ 2010 SP1 Redistributable Package (x64)</FullName> | ||
<ShortName>VS2010X64SP1</ShortName> | ||
<Source>http://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe</Source> | ||
<DestinationFolder>VS2010</DestinationFolder> | ||
<DestinationFile>vcredist_x64.exe</DestinationFile> | ||
<URL>http://www.microsoft.com</URL> | ||
<CommandType>NONE</CommandType> | ||
<Command></Command> | ||
<CommandLineSwitches></CommandLineSwitches> | ||
<VerifyAfterCommand></VerifyAfterCommand> | ||
</DownloadItem> | ||
<DownloadItem> | ||
<Comment></Comment> | ||
<FullName>Microsoft Visual C++ 2012 Update 4 Redistributable Package (x86)</FullName> | ||
<ShortName>VS2012X86SP1</ShortName> | ||
<Source>http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x86.exe</Source> | ||
<DestinationFolder>VS2012</DestinationFolder> | ||
<DestinationFile>vcredist_x86.exe</DestinationFile> | ||
<URL>http://www.microsoft.com</URL> | ||
<CommandType>NONE</CommandType> | ||
<Command></Command> | ||
<CommandLineSwitches></CommandLineSwitches> | ||
<VerifyAfterCommand></VerifyAfterCommand> | ||
</DownloadItem> | ||
<DownloadItem> | ||
<Comment></Comment> | ||
<FullName>Microsoft Visual C++ 2012 Update 4 Redistributable Package (x64)</FullName> | ||
<ShortName>VS2012X64SP1</ShortName> | ||
<Source>http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe</Source> | ||
<DestinationFolder>VS2012</DestinationFolder> | ||
<DestinationFile>vcredist_x64.exe</DestinationFile> | ||
<URL>http://www.microsoft.com</URL> | ||
<CommandType>NONE</CommandType> | ||
<Command></Command> | ||
<CommandLineSwitches></CommandLineSwitches> | ||
<VerifyAfterCommand></VerifyAfterCommand> | ||
</DownloadItem> | ||
<DownloadItem> | ||
<Comment></Comment> | ||
<FullName>Microsoft Visual C++ 2013 Redistributable Package v12(x86)</FullName> | ||
<ShortName>VS2013X86</ShortName> | ||
<Source>http://download.microsoft.com/download/0/5/6/056DCDA9-D667-4E27-8001-8A0C6971D6B1/vcredist_x86.exe</Source> | ||
<DestinationFolder>VS2013</DestinationFolder> | ||
<DestinationFile>vcredist_x86.exe</DestinationFile> | ||
<URL>http://www.microsoft.com</URL> | ||
<CommandType>NONE</CommandType> | ||
<Command></Command> | ||
<CommandLineSwitches></CommandLineSwitches> | ||
<VerifyAfterCommand></VerifyAfterCommand> | ||
</DownloadItem> | ||
<DownloadItem> | ||
<Comment></Comment> | ||
<FullName>Microsoft Visual C++ 2013 Redistributable Package v12 (x64)</FullName> | ||
<ShortName>VS2013X64</ShortName> | ||
<Source>http://download.microsoft.com/download/0/5/6/056DCDA9-D667-4E27-8001-8A0C6971D6B1/vcredist_x64.exe</Source> | ||
<DestinationFolder>VS2013</DestinationFolder> | ||
<DestinationFile>vcredist_x64.exe</DestinationFile> | ||
<URL>http://www.microsoft.com</URL> | ||
<CommandType>NONE</CommandType> | ||
<Command></Command> | ||
<CommandLineSwitches></CommandLineSwitches> | ||
<VerifyAfterCommand></VerifyAfterCommand> | ||
</DownloadItem> | ||
<DownloadItem> | ||
<Comment></Comment> | ||
<FullName>Microsoft Visual C++ 2015 Redistributable Update 3 (x86)</FullName> | ||
<ShortName>VS2015X86</ShortName> | ||
<Source>https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x86.exe</Source> | ||
<DestinationFolder>VS2015</DestinationFolder> | ||
<DestinationFile>vc_redist.x86.exe</DestinationFile> | ||
<URL>http://www.microsoft.com</URL> | ||
<CommandType>NONE</CommandType> | ||
<Command></Command> | ||
<CommandLineSwitches></CommandLineSwitches> | ||
<VerifyAfterCommand></VerifyAfterCommand> | ||
</DownloadItem> | ||
<DownloadItem> | ||
<Comment></Comment> | ||
<FullName>Microsoft Visual C++ 2015 Redistributable Update 3 (x64)</FullName> | ||
<ShortName>VS2015X64</ShortName> | ||
<Source>https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe</Source> | ||
<DestinationFolder>VS2015</DestinationFolder> | ||
<DestinationFile>vc_redist.x64.exe</DestinationFile> | ||
<URL>http://www.microsoft.com</URL> | ||
<CommandType>NONE</CommandType> | ||
<Command></Command> | ||
<CommandLineSwitches></CommandLineSwitches> | ||
<VerifyAfterCommand></VerifyAfterCommand> | ||
</DownloadItem> | ||
</Download> |
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,53 @@ | ||
Function Get-MDTOData{ | ||
<# | ||
.Synopsis | ||
Function for getting MDTOdata | ||
.DESCRIPTION | ||
Function for getting MDTOdata | ||
.EXAMPLE | ||
Get-MDTOData -MDTMonitorServer MDTSERVER01 | ||
.NOTES | ||
Created: 2016-03-07 | ||
Version: 1.0 | ||
Author - Mikael Nystrom | ||
Twitter: @mikael_nystrom | ||
Blog : http://deploymentbunny.com | ||
.LINK | ||
http://www.deploymentbunny.com | ||
#> | ||
Param( | ||
$MDTMonitorServer | ||
) | ||
$URL = "http://" + $MDTMonitorServer + ":9801/MDTMonitorData/Computers" | ||
$Data = Invoke-RestMethod $URL | ||
foreach($property in ($Data.content.properties) ){ | ||
$Hash = [ordered]@{ | ||
Name = $($property.Name); | ||
PercentComplete = $($property.PercentComplete.’#text’); | ||
Warnings = $($property.Warnings.’#text’); | ||
Errors = $($property.Errors.’#text’); | ||
DeploymentStatus = $( | ||
Switch($property.DeploymentStatus.’#text’){ | ||
1 { "Active/Running"} | ||
2 { "Failed"} | ||
3 { "Successfully completed"} | ||
Default {"Unknown"} | ||
} | ||
); | ||
StepName = $($property.StepName); | ||
TotalSteps = $($property.TotalStepS.'#text') | ||
CurrentStep = $($property.CurrentStep.'#text') | ||
DartIP = $($property.DartIP); | ||
DartPort = $($property.DartPort); | ||
DartTicket = $($property.DartTicket); | ||
VMHost = $($property.VMHost.'#text'); | ||
VMName = $($property.VMName.'#text'); | ||
LastTime = $($property.LastTime.'#text') -replace "T"," "; | ||
StartTime = $($property.StartTime.’#text’) -replace "T"," "; | ||
EndTime = $($property.EndTime.’#text’) -replace "T"," "; | ||
} | ||
New-Object PSObject -Property $Hash | ||
} | ||
} |
Oops, something went wrong.