Closed
Description
Is there any method to save a file opened in the editor? Ideally, to save if it
is modified. If there is a way to check the modified state then I am just
looking for a way to save.
The context. I am working on Invoke-TaskFromVSCode
, similar to Invoke-TaskFromISE
.
The script with tasks should be saved before invoking the current task from it.
In ISE it looks like
$file = $psISE.CurrentFile
if (!$file.IsSaved) {
$file.Save()
}