Source: StackOverflow
With a Linux Guest run this:
sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile
Add-Type -AssemblyName System.Web | |
Add-Type -AssemblyName System.Net.Http | |
$ENV:PATH="$ENV:PATH;C:\Temp\d365fo.tools\nuget" | |
#requires -version 5 | |
<# | |
.SYNOPSIS | |
High Performance Powershell Module Installation | |
.DESCRIPTION | |
This is a proof of concept for using the Powershell Gallery OData API and HTTPClient to parallel install packages |
# Download latest dotnet/codeformatter release from github | |
$repo = "jgm/pandoc" | |
$filenamePattern = "*x86_64.zip" | |
$pathExtract = "C:\Tools\pandoc" | |
$innerDirectory = $true | |
$preRelease = $false | |
if ($preRelease) { | |
$releasesUri = "https://api.github.com/repos/$repo/releases" |
# Hack to ignore versioning of the dll file and folder structure | |
$folderName = (Get-ChildItem -Path "C:\Program Files\WindowsPowerShell\Modules\AzureAD\2.0.*\Microsoft.IdentityModel.Clients.ActiveDirectory.dll").Directory.Name | Sort-Object -Descending | Select-Object -First 1 | |
# ADAL Helper Lib | |
Add-Type -Path "c:\Program Files\WindowsPowerShell\Modules\AzureAD\$folderName\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" | |
# Azure tenant | |
$tenant = "" | |
# Application ID for Powershell client | |
$client_Id = "1950a258-227b-4e31-a9cf-717495945fc2" | |
# Login URI |
Function Show-ModExplore { | |
<# | |
.SYNOPSIS | |
Generate all the exploration I normally do when I want to install a new PowerShell module | |
.DESCRIPTION | |
Script to generate all the exploration I normally do when I want to install a new PowerShell module |
$Function = 'Get-DbcCheck' | |
Describe "$Function" { | |
Context "Checking $Function Examples" { | |
$Examples = Get-Help $Function -Examples | |
foreach ($examplecode in $Examples.examples.example.Code) { | |
It "Example Code $examplecode should not throw" { | |
{$examplecode} | Should -Not -Throw | |
} |
$excludeCommands = @( | |
"Invoke-D365SCDPBundleInstall" | |
) | |
$commandsRaw = Get-Command -Module d365fo.tools | |
if ($excludeCommands.Count -gt 0) { | |
$commands = $commandsRaw | Select-String -Pattern $excludeCommands -SimpleMatch -NotMatch | |
} |
function Get-Header ($text) { | |
$start = $text.IndexOf('<#') | |
$temp = $start - 2 | |
if($temp -gt 0) { | |
$text.SubString(0, $start - 2) | |
} | |
else { | |
"" | |
} | |
} |
Source: StackOverflow
With a Linux Guest run this:
sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile