Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/code/SavePSResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ public string Path
set
{
string resolvedPath = string.Empty;
if (!string.IsNullOrEmpty(value))
if (string.IsNullOrEmpty(value))
{
// If the user does not specify a path to save to, use the user's current working directory
resolvedPath = SessionState.Path.GetResolvedPSPathFromPSPath(SessionState.Path.CurrentFileSystemLocation.Path).First().Path;
}
else {
resolvedPath = SessionState.Path.GetResolvedPSPathFromPSPath(value).First().Path;
}

Expand Down Expand Up @@ -155,12 +159,6 @@ protected override void BeginProcessing()
// This is to create a better experience for those who have just installed v3 and want to get up and running quickly
RepositorySettings.CheckRepositoryStore();

// If the user does not specify a path to save to, use the user's current working directory
if (string.IsNullOrWhiteSpace(_path))
{
_path = SessionState.Path.CurrentLocation.Path;
}

_installHelper = new InstallHelper(cmdletPassedIn: this);
}

Expand Down