This project aims to simplify consuming NuGet packages in PowerShell. More info coming soon...
(new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/ligershark/nuget-powershell/master/get-nugetps.ps1") | iex
(new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/ligershark/nuget-powershell/master/get-nugetps.ps1") | iex
$jsonnetpath = (Get-NuGetPackage Newtonsoft.Json -prerelease -binpath)
Add-Type -Path (Join-Path $jsonnetpath 'Newtonsoft.Json.dll')
# now we can call apis from json.net
$jsonString = @"
{
/* Click to learn more about project.json http://go.microsoft.com/fwlink/?LinkID=517074 */
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"EntityFramework.SqlServer": "7.0.0-beta3",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta3"
},
"commands": {
/* Change the port number when you are self hosting this application */
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
"gen": "Microsoft.Framework.CodeGeneration"
}
}
"@
'webroot: "{0}"' -f [Newtonsoft.Json.JsonConvert]::DeserializeObject($jsonString)['webroot'].value
$imgOptExe = (Join-Path (Get-NuGetPackage AzureImageOptimizer -prerelease -binpath) 'ImageCompressor.Job.exe')
&$imgOptExe /d c:\temp\images\to-optimize --force --noreport
if(Test-Path "$pwd\sample-style.css"){Remove-Item "$pwd\sample-style.css"}
(New-Object System.Net.WebClient).DownloadFile('http://www.csszengarden.com/examples/style.css', "$(pwd)\sample-style.css")
& "$(Get-NuGetPackage -name AzureMinifier -prerelease -binpath)TextMinifier.job.exe" /d $pwd --noreport
# get sample files from gist
(new-object Net.WebClient).DownloadString("https://gist.githubusercontent.com/sayedihashimi/581878c375db22eabd22/raw/eb4e4d5e0c66448f6aed1c898ea0c7991bd970c8/sample.config") | Set-Content .\sample.config
(new-object Net.WebClient).DownloadString("https://gist.githubusercontent.com/sayedihashimi/581878c375db22eabd22/raw/b54d648ed5e316801b8323da91506ff9d3a136a7/sample.transform.config") | Set-Content .\sample.transform.config
if((Test-Path .\final.config)){
Remove-Item .\final.config
}
$xdtexe = (join-path (Get-NuGetPackage SlowCheetah.Xdt -prerelease -binpath) SlowCheetah.Xdt.exe)
# invoke SlowCheetah.Xdt.exe
&($xdtexe) .\sample.config .\sample.transform.config .\final.config