Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: SessionOptions.AddRawSettings(HashTable) Support

Thanks for your suggestion! We will consider it.
iokevins

SessionOptions.AddRawSettings(HashTable) Support

I think adding support for Subject (or similar support for multiple updates) might simplify the PowerShell scripting experience; for example:

[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:
public void AddRawSettings(string setting, string value)

{
    RawSettings.Add(setting, value);
}

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

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

$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