Team Ai
Datasetpublic

MegaBites-AI/Windows-powershell

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes372downloads
Security.types.ps1xml125 linesDownload Raw Back to Microsoft.PowerShell.Security
1<?xml version="1.0" encoding="utf-8" ?>2<!-- *******************************************************************3These sample files contain type information used by the PowerShell engine.4Do not edit or change the contents of this file directly.5Please see the PowerShell documentation or type "Get-Help Update-TypeData"6for more information.7 8Copyright (c) Microsoft Corporation.9 10THIS SAMPLE CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY11OF ANY KIND,WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO12THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR13PURPOSE. IF THIS CODE AND INFORMATION IS MODIFIED, THE ENTIRE RISK OF USE14OR RESULTS IN CONNECTION WITH THE USE OF THIS CODE AND INFORMATION15REMAINS WITH THE USER.16******************************************************************** -->17 18<Types>19  <Type>20    <Name>System.Security.AccessControl.ObjectSecurity</Name>21    <Members>22      <CodeProperty>23        <Name>Path</Name>24        <GetCodeReference>25          <TypeName>Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase</TypeName>26          <MethodName>GetPath</MethodName>27        </GetCodeReference>28      </CodeProperty>29      <CodeProperty>30        <Name>Owner</Name>31        <GetCodeReference>32          <TypeName>Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase</TypeName>33          <MethodName>GetOwner</MethodName>34        </GetCodeReference>35      </CodeProperty>36      <CodeProperty>37        <Name>Group</Name>38        <GetCodeReference>39          <TypeName>Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase</TypeName>40          <MethodName>GetGroup</MethodName>41        </GetCodeReference>42      </CodeProperty>43      <CodeProperty>44        <Name>Access</Name>45        <GetCodeReference>46          <TypeName>Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase</TypeName>47          <MethodName>GetAccess</MethodName>48        </GetCodeReference>49      </CodeProperty>50      <CodeProperty>51        <Name>Sddl</Name>52        <GetCodeReference>53          <TypeName>Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase</TypeName>54          <MethodName>GetSddl</MethodName>55        </GetCodeReference>56      </CodeProperty>57      <ScriptProperty>58        <Name>AccessToString</Name>59        <GetScriptBlock>60          $toString = "";61          $first = $true;62          if ( ! $this.Access ) { return "" }63          foreach($ace in $this.Access)64          {65          if($first)66          {67          $first = $false;68          }69          else70          {71          $tostring += "`n";72          }73          $toString += $ace.IdentityReference.ToString();74          $toString += " ";75          $toString += $ace.AccessControlType.ToString();76          $toString += "  ";77          if($ace -is [System.Security.AccessControl.FileSystemAccessRule])78          {79          $toString += $ace.FileSystemRights.ToString();80          }81          elseif($ace -is  [System.Security.AccessControl.RegistryAccessRule])82          {83          $toString += $ace.RegistryRights.ToString();84          }85          }86          return $toString;87        </GetScriptBlock>88      </ScriptProperty>89      <ScriptProperty>90        <Name>AuditToString</Name>91        <GetScriptBlock>92          $toString = "";93          $first = $true;94          if ( ! (&amp; { Set-StrictMode -Version 1; $this.audit }) ) { return "" }95          foreach($ace in (&amp; { Set-StrictMode -Version 1; $this.audit }))96          {97          if($first)98          {99          $first = $false;100          }101          else102          {103          $tostring += "`n";104          }105          $toString += $ace.IdentityReference.ToString();106          $toString += " ";107          $toString += $ace.AuditFlags.ToString();108          $toString += "  ";109          if($ace -is [System.Security.AccessControl.FileSystemAuditRule])110          {111          $toString += $ace.FileSystemRights.ToString();112          }113          elseif($ace -is [System.Security.AccessControl.RegistryAuditRule])114          {115          $toString += $ace.RegistryRights.ToString();116          }117          }118          return $toString;119        </GetScriptBlock>120      </ScriptProperty>121    </Members>122  </Type>123 124</Types>125