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
$sourceDir = '<Feed Storage Path>' | |
$targetDir = '<Target Drop Folder Path>' | |
$packageIndex = 1 | |
Get-ChildItem $sourceDir *.* -Recurse | foreach($_) { | |
if (-not $_.PSIsContainer) { | |
$ext = [System.IO.Path]::GetExtension($_.Name) | |
Copy-Item -Path $_.FullName -Destination (Join-Path -Path $targetDir -ChildPath "$packageIndex$ext") | |
$packageIndex = $packageIndex + 1 |
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
DECLARE @Target_Feed_Id INT = <Target Feed ID> | |
DECLARE @xmldata XML =( | |
SELECT * | |
FROM OPENROWSET(BULK 'C:\path\to\exported\data.xml', SINGLE_BLOB) AS X) | |
INSERT INTO [MavenArtifacts] | |
SELECT [Feed_Id] = @Target_Feed_Id, | |
[GroupId_Text] = P.A.value('@Group','NVARCHAR(200)'), | |
[ArtifactId_Text] = P.A.value('@Id', 'NVARCHAR(100)'), |
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
SELECT xmlelement(name "Package", xmlattributes("GroupId_Text" AS "Group", | |
"ArtifactId_Text" AS "Id", | |
"Name_Text" AS "Name", | |
"Description_Text" AS "Description", | |
"ReleaseVersion_Text" AS "Release", | |
"LatestVersion_Text" AS "Latest"), | |
(SELECT xmlagg(xmlelement(name "Version", xmlattributes("Version_Text" AS "Version", | |
"File_Type" AS "Type", | |
"File_SHA1_Bytes" AS "SHA1", | |
"File_MD5_Bytes" AS "MD5", |
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
DECLARE @Feed_Id INT = <FEED ID> | |
SELECT [@Group] = M.[GroupId_Text], | |
[@Id] = M.[ArtifactId_Text], | |
[@Name] = M.[Name_Text], | |
[@Description] = M.[Description_Text], | |
[@Release] = M.[ReleaseVersion_Text], | |
[@Latest] = [LatestVersion_Text], | |
(SELECT [@Version] = F.[Version_Text], | |
[@Type] = F.[File_Type], |
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
<# | |
.Synopsis | |
Transfers a file to a ProGet asset directory. | |
.Description | |
Transfers a file to a ProGet asset directory. This function performs automatic chunking | |
if the file is larger than a specified threshold. | |
.Parameter FileName | |
Name of the file to upload from the local file system. |