Source: StackOverflow
With a Linux Guest run this:
sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile
Source: StackOverflow
With a Linux Guest run this:
sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile
function Get-Header ($text) { | |
$start = $text.IndexOf('<#') | |
$temp = $start - 2 | |
if($temp -gt 0) { | |
$text.SubString(0, $start - 2) | |
} | |
else { | |
"" | |
} | |
} |
$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 | |
} |
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 |
$excludeCommands = @( | |
"Invoke-D365SCDPBundleInstall" | |
) | |
$commandsRaw = Get-Command -Module d365fo.tools | |
if ($excludeCommands.Count -gt 0) { | |
$commands = $commandsRaw | Select-String -Pattern $excludeCommands -SimpleMatch -NotMatch | |
} |
#Fill in the command that you want to generate an pester test for its examples | |
$commandName = "New-D365SelfSignedCertificate" | |
#The path where it traverse it's ways to get the file. Filename has to match the commandname | |
$file = Get-ChildItem -Path "C:\GIT\GITHUB\d365fo.tools.Workspace\d365fo.tools\d365fo.tools" -Recurse -Filter "$commandName.ps1" | Select-Object -First 1 | |
# dot source load the file into current session | |
. $($file.Fullname) | |
$sb = [System.Text.StringBuilder]::new() |
$moduleName = "d365fo.tools" | |
#$path = "C:\GIT\GITHUB\$moduleName.Workspace\$moduleName\$moduleName" | |
$path = "C:\GITHUB\LocalRepository\$moduleName" | |
function Get-Header ($text) { | |
$start = $text.IndexOf('<#') | |
$temp = $start - 2 | |
if($temp -gt 0) { | |
$text.SubString(0, $start - 2) | |
} |
$moduleName = "d365fo.tools" | |
#$path = "C:\GIT\GITHUB\$moduleName.Workspace\$moduleName\$moduleName" | |
$path = "C:\GITHUB\LocalRepository\$moduleName" | |
Import-Module $path -Force | |
$excludeCommands = @() | |
$commandsRaw = Get-Command -Module $moduleName |
$moduleName = "d365fo.tools" | |
#$path = "C:\GIT\GITHUB\$moduleName.Workspace\$moduleName\$moduleName" | |
$path = "C:\GITHUB\LocalRepository\$moduleName" | |
Import-Module $path -Force | |
$null = New-MarkdownHelp -Module $moduleName -OutputFolder "$path\docs" -Force | |
Get-ChildItem -Path "$path\docs" -Recurse -File | Set-PSMDEncoding |
Remove-Item "$env:APPDATA\GitHub Desktop\window-state.json" -Force |