Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Requires -Version 5.1 | |
| # Reference: 1) https://learn.microsoft.com/en-us/dotnet/api/system.io.file.replace?view=netframework-4.8.1 | |
| # Reference: 2) https://learn.microsoft.com/en-us/dotnet/api/system.io.file?view=netframework-4.8.1 | |
| # Reference: 3) https://learn.microsoft.com/en-us/dotnet/api/system.io.filemode?view=netframework-4.8.1 | |
| # Reference: 4) https://learn.microsoft.com/en-us/dotnet/api/system.io.fileaccess?view=netframework-4.8.1 | |
| # Example 1: Atomic in-place file replace using File.Replace, which swaps a source file into | |
| # the destination path atomically, preserving the destination's ACLs, ownership, and metadata | |
| # while optionally retaining a backup of the original destination file | |
| $SourcePath = "" # Path to source/replacement file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| generate_fgdb_collection.py | |
| ================== | |
| Build a deterministic collection of synthetic file geodatabases for timing | |
| arcpy.da.Walk and comparing traversal strategies (sequential filtered | |
| walks vs. list-datatype walks vs. threaded walks). | |
| Each profile produces one .gdb directory plus a <name>.manifest.json sidecar | |
| listing the expected catalog items, so later timing runs can also double as |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Reference: 1) https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/query-user | |
| # Example 1: Query user sessions locally on a Remote Desktop Session Host, parse results as a | |
| # formatted table using Substring, and return session information as a properly-typed | |
| # PowerShell object | |
| query user | | |
| Select-Object -Skip 1 | | |
| ForEach-Object { | |
| [pscustomobject]@{ | |
| UserName = $_.Substring(1, 20).Trim() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Requires -Version 5.1 | |
| # Reference: 1) https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-acl?view=powershell-5.1 | |
| $DirectoryPath = "" # Path to directory, and subdirectories, to apply changes | |
| $ExistingAccountName = "" # samAccountName or UserPrincipalName of account with existing | |
| # file system object ACLs | |
| $NewAccountName = "" # samAccountName or UserPrincipalName of account to assign | |
| # file system object ACLs | |
| # Example 1: Replace existing account access with same access for new account |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!python | |
| # Reference: 1) https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/describe.htm | |
| # 2) https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-feature-class.htm | |
| # 3) https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-table.htmarc | |
| # 4) https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/data-access-using-cursors.htm | |
| # 5) https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/clear-workspace-cache.htm | |
| import arcpy | |
| from arcpy.management import CreateFeatureclass , CreateTable, ClearWorkspaceCache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Requires -Version 5.1 | |
| # Reference: 1) https://github.com/Esri/cim-spec | |
| # Reference: 2) https://learn.microsoft.com/en-us/dotnet/api/system.xml.xmldocument?view=netframework-4.8.1 | |
| # Reference: 3) https://learn.microsoft.com/en-us/dotnet/api/system.xml.xmlelement?view=netframework-4.8.1 | |
| # Reference: 4) https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_switch?view=powershell-5.1 | |
| # Example 1: A function to convert Esri Cartographic Information Model (CIM) XML to a custom PSObject | |
| # that has a property for each field in the XML content. | |
| function ConvertFrom-EsriXml { | |
| <# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Requires -Version 5.1 | |
| # Reference: 1) https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.runspaces.runspace?view=powershellsdk-1.1.0 | |
| # Reference: 2) https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.powershell?view=powershellsdk-1.1.0 | |
| # Reference: 3) https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/write-progress?view=powershell-5.1 | |
| # Reference: 4) https://learn.microsoft.com/en-us/dotnet/api/system.collections.arraylist?view=netframework-4.8.1 | |
| # Example 1: Continuously watch Windows diagnostic counters in console progress bar | |
| $Counters = @( # Windows diagnostic counter(s) | |
| "\Processor(_total)\% Processor Time" | |
| "\Memory\% Committed Bytes In Use" |
NewerOlder