You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PowerShell script uses the ImportExcel module to read an Excel file and multiply the units by 20%. It first gets the schema of the Excel file using the Get-ExcelFileSchema function, then creates chat messages for the user and system. The user is prompted to "read the excel file" and "multiply the units by 20%". The script then uses the Get-CompletionFromMessages function to get completion from the chat messages and outputs the second to second-to-last lines of the content. Finally, it outputs the PowerShell code that reads the Excel file, multiplies the units by 20%, and formats the output as a table.
5
+
#>
6
+
7
+
# Set the path to the Excel file
8
+
$path="$PSScriptRoot\salesData.xlsx"
9
+
10
+
# Get the schema of the Excel file using the ImportExcel module
11
+
$schema=Get-ExcelFileSchema$path
12
+
13
+
# Create chat messages for the user and system
14
+
$messages=@()
15
+
$messages+=New-ChatMessageTemplate-Role system -Content (@'
16
+
You are a great PowerShell assistant. Based on the attached
0 commit comments