Notities

Notities

ing. M.A.C.M. (Martijn) van den Boom
ingenieur, docent en mentor

Social Media Links:

van den Boom

1 minuut leestijd

Function Opschonen-geheugen {

  Get-PSSession | Remove-PSSession
  [System.GC]::Collect()         
  [GC]::Collect()
  [GC]::WaitForPendingFinalizers()

  Get-Variable |
  #Where-Object { $startupVariables -notcontains $_.Name } |
  ForEach-Object {
    try {
      Clear-Variable -Name "$($_.Name)" -Force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
      Remove-Variable -Name "$($_.Name)" -Force -Scope "global" -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
      Remove-Variable -Name "$($_.Name)" -Force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
      #Write-Host "Variabele '$($_.Name)' is opgeruimd."
    }
    catch [Exception] {
      if ($_.Name -notlike '') { Write-Host "An error has occured. Error Details: $($_.Exception.Message)" }
    }
  }

  #Get-Variable

}

Recente berichten

Categorieën

Over Mij

This theme was developed for Hugo static site generator.