Skip to content

Instantly share code, notes, and snippets.

@bielawb
Created July 11, 2022 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bielawb/d0ba5dae7908c805c5fdf5c313581e63 to your computer and use it in GitHub Desktop.
Save bielawb/d0ba5dae7908c805c5fdf5c313581e63 to your computer and use it in GitHub Desktop.
Pobieranie informacji o otwartym pliku z $psISE
if (
($file = $psISE.CurrentFile) -and
(Test-Path -LiteralPath $file.FullPath) -and
($line = $file.Editor.CaretLineText) -and
($lineNumber = $file.Editor.CaretLine)
) {
if (-not $file.IsSaved) {
Write-Warning -Message "File $($file.FullPath) is not saved - working on current copy on disk!"
}
$config = [PesterConfiguration]@{
Run = @{
Path = $file.FullPath
}
}
# ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment