// Token: 0x060073DE RID: 29662 RVA: 0x0017DAF4 File Offset: 0x0017BCF4
        public static IPowerShellBudget AcquireFallback(string identifier, BudgetType budgetType)
        {
            PowerShellBudget.VerifyCorrectBudgetType(budgetType);
            PowerShellBudget innerBudget = PowerShellBudgetCache.Singleton.Get(new StringBudgetKey(identifier, false, budgetType));

            return(new PowerShellBudgetWrapper(innerBudget));
        }
        // Token: 0x060073DD RID: 29661 RVA: 0x0017DAC4 File Offset: 0x0017BCC4
        public static IPowerShellBudget Acquire(SecurityIdentifier callerSid, BudgetType budgetType, ADSessionSettings settings)
        {
            PowerShellBudget.VerifyCorrectBudgetType(budgetType);
            PowerShellBudget innerBudget = PowerShellBudgetCache.Singleton.Get(new SidBudgetKey(callerSid, budgetType, false, settings));

            return(new PowerShellBudgetWrapper(innerBudget));
        }
        // Token: 0x060073EA RID: 29674 RVA: 0x0017E354 File Offset: 0x0017C554
        public string GetCmdletBudgetUsage()
        {
            string result;

            lock (base.SyncRoot)
            {
                if (this.cmdletsRemaining == 9223372036854775807L && this.destructiveCmdletsRemaining == 9223372036854775807L && base.CasTokenBucket is UnthrottledTokenBucket)
                {
                    result = null;
                }
                else
                {
                    result = string.Format("ExchangeCmdlet:{0}/{1}/{2} DestructiveCmdlet:{3}/{4}/{5} Balance:{6}/{7}/{8}", new object[]
                    {
                        PowerShellBudget.GetUserFriendlyLongValue(this.exchangeCmdletsRemaining),
                        this.exchangeMaxCmdletsPolicyValue,
                        this.powerShellMaxCmdletsTimePeriodPolicyValue,
                        PowerShellBudget.GetUserFriendlyLongValue(this.destructiveCmdletsRemaining),
                        this.powerShellMaxDestructiveCmdletsPolicyValue,
                        this.powerShellMaxDestructiveCmdletsTimePeriodPolicyValue,
                        base.GetBalanceForTrace(),
                        base.CasTokenBucket.RechargeRate,
                        base.CasTokenBucket.MinimumBalance
                    });
                }
            }
            return(result);
        }
        // Token: 0x060073E9 RID: 29673 RVA: 0x0017E260 File Offset: 0x0017C460
        public string GetWSManBudgetUsage()
        {
            string result;

            lock (base.SyncRoot)
            {
                if (this.activeRunspaces == 2147483647 && this.runspacesRemaining == 9223372036854775807L && this.cmdletsRemaining == 9223372036854775807L)
                {
                    result = null;
                }
                else
                {
                    result = string.Format("Concurrency:{0}/{1} RunSpaces:{2}/{3}/{4} PowerShellCmdlet:{5}/{6}/{7}", new object[]
                    {
                        this.activeRunspaces,
                        this.activeRunspacesPolicyValue,
                        PowerShellBudget.GetUserFriendlyLongValue(this.runspacesRemaining),
                        this.powerShellMaxRunspacesPolicyValue,
                        this.powerShellMaxRunspacesTimePeriodPolicyValue,
                        PowerShellBudget.GetUserFriendlyLongValue(this.cmdletsRemaining),
                        this.powerShellMaxCmdletsPolicyValue,
                        this.powerShellMaxCmdletsTimePeriodPolicyValue
                    });
                }
            }
            return(result);
        }
        // Token: 0x060073DC RID: 29660 RVA: 0x0017DA84 File Offset: 0x0017BC84
        public static IPowerShellBudget Acquire(BudgetKey budgetKey)
        {
            if (budgetKey == null)
            {
                throw new ArgumentNullException("budgetKey");
            }
            PowerShellBudget.VerifyCorrectBudgetType(budgetKey.BudgetType);
            PowerShellBudget innerBudget = PowerShellBudgetCache.Singleton.Get(budgetKey);

            return(new PowerShellBudgetWrapper(innerBudget));
        }
예제 #6
0
 internal PswsBudgetWrapper(PowerShellBudget innerBudget) : base(innerBudget)
 {
 }