PoshCode Archive  Artifact Content

Artifact b997f079d644b0503faadf3c23ade0067078cdcdc28fa0169e3195641f1afefd:

  • File Save-CurrentFile-ISE.ps1 — part of check-in [cad7e0aebc] at 2018-06-10 12:56:52 on branch trunk — Why to use a FileselectionBox to save your fresh files from ISE, don’t you know your file system? OK perhaps an encoding parameter would be fine, but please don’t default it to ASCII. (user: unknown size: 602)

# encoding: ascii
# api: powershell
# title: Save-CurrentFile (ISE)
# description: Why to use a FileselectionBox to save your fresh files from ISE, don’t you know your file system? OK perhaps an encoding parameter would be fine, but please don’t default it to ASCII.
# version: 0.1
# type: function
# license: CC0
# function: Save-CurrentFile
# x-poshcode-id: 1318
# x-archived: 2009-09-16T23:59:55
#
#
function Save-CurrentFile ($path)
{
    $psISE.CurrentFile.SaveAs($path)
    $psISE.CurrentFile.Save([Text.Encoding]::default)

}

# Save-CurrentFile '.\Save-CurrentFile.ps1'