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 { | |
| "" | |
| } | |
| } |
| $excludeCommands = @( | |
| "Invoke-D365SCDPBundleInstall" | |
| ) | |
| $commandsRaw = Get-Command -Module d365fo.tools | |
| if ($excludeCommands.Count -gt 0) { | |
| $commands = $commandsRaw | Select-String -Pattern $excludeCommands -SimpleMatch -NotMatch | |
| } |
| $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 |
| #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() |
| #Based on: https://mcpmag.com/articles/2019/04/18/pester-test-report-in-html.aspx | |
| <# | |
| Invoke-Pester -Path "C:\GIT\GITHUB\dbatools.Workspace\Test-Examples.ps1" -OutputFile 'C:\Temp\dbatools_pester_results.xml' -OutputFormat NUnitXml | |
| C:\GIT\GITHUB\dbatools.Workspace\ReportUnit.exe "C:\Temp\dbatools_pester_results.xml" "C:\Temp\PesterReport.html" | |
| Start-Process "C:\Temp\PesterReport.html" | |
| #> | |
| Import-Module "C:\GIT\GITHUB\dbatools.Workspace\dbatools" -Force |
| $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 |