Ejemplo n.º 1
0
 /// <summary>
 /// Removes global variable from current PowerShell session.
 /// </summary>
 /// <param name="variableName">Name of the variable we want to delete.</param>
 internal void RemovePowerShellVariable(EwsPowerShellVariable variableName)
 {
     PSVariable variableToRemove = this.GetPowerShellVariable(variableName);
     this.SessionState.PSVariable.Remove(variableToRemove);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets global variable inside PowerShell session.
 /// </summary>
 /// <param name="variableName">Predefined variable names.</param>
 /// <param name="variableValue">Value that will be held by variable.</param>
 internal void SetPowerShellVariable(EwsPowerShellVariable variableName, object variableValue)
 {
     this.SessionState.PSVariable.Set(variableName.ToString(), variableValue);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets global variable from current PowerShell session. Returns
 /// null if no variable set.
 /// </summary>
 /// <param name="variableName">Name of variable that we want value from.</param>
 /// <returns>PSVariable</returns>
 internal PSVariable GetPowerShellVariable(EwsPowerShellVariable variableName)
 {
     return this.SessionState.PSVariable.Get(variableName.ToString());
 }