Today I began the process to upgrade our python scripts from 2.7 to 3.x and I wanted to utilize the Analyze Tools for Pro but I didn't want to have to search for every python script in my file share to then manually run it in the tool. Therefore I built this script to walk through a directory, find all the python scripts, and then iterate them through the tool automatically. I felt if I wanted to use this script someone else might want it as well! Hope this helps!
import arcpy, os
searchDir = "\\\\{server}\\{share}\\{folder}"
outputPath = "C:\\Users\\{user name}\\Desktop\\Tool Analysis\\"
Scripts = {}
for subdir, dirs, files in os.walk(searchDir):
for a in files:
if a.endswith(".py"):
FileName = os.path.splitext(a)[0]
path = os.path.join(subdir,a)
Scripts[FileName]= path
for b in Scripts:
name = b
filepath = Scripts[b]
outfile = outputPath+name+".txt"
arcpy.AnalyzeToolsForPro_management(filepath, outfile)