<# .SYNOPSIS Find, get Jupyter notebook codes in yxmc, yxwz, and yxmd files and write in the same directory as these files. .DESCRIPTION Find, get Jupyter notebook codes in yxmc, yxwz, and yxmd files and write in the same directory as these files. The filenames of the created files follow the following conversion: "(Alteryx filename) (ID) (Name).ipynb" .PARAMETER Path Specifies the path to the location of the files. .EXAMPLE Get-JupterCodeInAlteryxFiles .\ .NOTES Version: 1.0 Author: Abner Gomes de Sá Creation Date: 2022-03-30 Purpose/Change: Get Jupyter notebook codes in Alteryx files. #> Param ( [Parameter(Mandatory=$True, Position=1)] [string]$Path ) Write-Host $Path Get-ChildItem -Path $Path\* -Include *.yxmc, *.yxwz, *.yxmd | ` ForEach-Object { Select-Xml ` -Path $_.FullName ` -XPath "//Node[./GuiSettings[@Plugin='JupyterCode']]" ` } | ` Select-Object ` Path, @{ N = "Directory" E = {(Get-Item $_.Path).Directory.FullName} }, ` @{ N = "FileName" E = {[System.IO.Path]::GetFileName($_.Path)} }, ` @{ N = "ToolID" E = {$_.Node.Attributes['ToolID'].'#text'} }, ` @{ N = "Name" E = {$_.Node.Properties.Annotation.Name} }, ` @{ N = "Notebook" E = {$_.Node.Properties.Configuration.Notebook.InnerText.TrimStart('')} } | ` ForEach-Object { ` $Path = "$($_.Directory)\$($_.FileName) $($_.ToolId) $($_.Name).ipynb" $_.Notebook | Out-File -Path $Path Write-Host $Path }