Topic "SessionOptions.AddRawSettings(HashTable) Support"

Author Message
iokevins
[View user's profile]

Joined: 2016-06-08
Posts: 5
Location: USA
I think adding support for Subject (or similar support for multiple updates) might simplify the PowerShell scripting experience; for example:

Code:

[hashtable] $SiteProfileRawSettings = @{CacheDirectoryChanges = 0; FtpPingInterval = 60; CacheDirectories = 0}
$SessionOptions.AddRawSettings($SiteProfileRawSettings)

What do you think (?) Note: I think good to keep existing AddRawSettings(string, string), for backwards compatibility; this would likely represent a new function.

Currently, SessionOptions.AddRawSettings(...) represents a wrapper function accepting two string objects:
Code:
public void AddRawSettings(string setting, string value)
{
    RawSettings.Add(setting, value);
}

Where object RawSettings represents an internal Dictionary object:
Code:
internal Dictionary<string, string> RawSettings { get; private set; }

For multiple updates, this seems to imply setting values iteratively; for example, for hashtable SiteProfileRawSettings:

Code:

$SiteProfileRawSettings = @{CacheDirectoryChanges = 0; FtpPingInterval = 60; CacheDirectories = 0}

Foreach ($Key in $($SiteProfileRawSettings.Keys)) {
  $SessionOptions.AddRawSettings($Key, $SiteProfileRawSettings[$Key])
}

[DBG]: PS C:\>> $SiteProfileRawSettings

Name                           Value                                                                                                         
----                           -----                                                                                                         
CacheDirectoryChanges          0                                                                                                             
FtpPingInterval                60                                                                                                           
CacheDirectories               0   
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26330
Location: Prague, Czechia
Thanks for your suggestion! We will consider it.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License