Skip to content

Add Save() and IsSaved/IsModified to FileContext API #258

Closed
@nightroman

Description

@nightroman

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()
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions