Prompt

PowerShell Code Quality Deep Dive 🔍

This prompt provides a comprehensive, multi-stage analysis of PowerShell scripts, evaluating them against key software development best practices. It uses a structured evaluation…

Productivity Topic

PowerShell Code Quality Deep Dive 🔍

Productivity

Productivity

This prompt provides a comprehensive, multi-stage analysis of PowerShell scripts, evaluating them against key software development best practices. It uses a structured evaluation…

Evaluate the provided PowerShell code for quality and adherence to best practices using a three-stage analytical approach. **Stage 1 - Initial Analysis:** Conduct a preliminary assessment of the code based on the criteria listed below. Do not present the results of this initial assessment.

**Stage 2 - In-Depth Analysis:** Perform a deeper analysis, considering the insights gained from the initial assessment. Do not present the results of this secondary assessment. **Stage 3 - Final Synthesis:** Synthesize insights from both previous analyses to present a comprehensive evaluation.

This final analysis will be the basis of your response. **Evaluation Framework:** Present your final analysis using the following structure: 1. **Category Evaluation:** Evaluate the code across these categories: a. Readability and Formatting (clarity, consistent style, naming conventions) b.

Error Handling and Logging (robustness, capture and handling of errors, informative logging) c. Performance and Efficiency (resource utilization, execution speed, optimized logic) d. Security and Best Practices (protection against vulnerabilities, adherence to secure coding principles) e.

Modularity and Reusability (organized into reusable components, limited code duplication) f. Documentation and Comments (clear/concise code comments, appropriate use of documentation) 2. **Category Scoring:** Assign a score (1-10) to each category: * 1-3: Poor * 4-6: Adequate * 7-8: Good * 9-10: Excellent 3.

**Category Feedback:** For each category, provide: * a brief explanation of the assigned score * specific strengths and weaknesses observed in the provided code * actionable suggestions for improvement 4. **Overall Score Calculation:** Calculate an overall score by averaging the individual category scores.

Evaluate the provided PowerShell code for quality and adherence to best practices using a three-stage analytical approach.

**Stage 1 - Initial Analysis:** Conduct a preliminary assessment of the code based on the criteria listed below. Do not present the results of this initial assessment.

**Stage 2 - In-Depth Analysis:** Perform a deeper analysis, considering the insights gained from the initial assessment. Do not present the results of this secondary assessment.

**Stage 3 - Final Synthesis:** Synthesize insights from both previous analyses to present a comprehensive evaluation. This final analysis will be the basis of your response.

**Evaluation Framework:** Present your final analysis using the following structure:

1. **Category Evaluation:** Evaluate the code across these categories:
    a. Readability and Formatting (clarity, consistent style, naming conventions)
    b. Error Handling and Logging (robustness, capture and handling of errors, informative logging)
    c. Performance and Efficiency (resource utilization, execution speed, optimized logic)
    d. Security and Best Practices (protection against vulnerabilities, adherence to secure coding principles)
    e. Modularity and Reusability (organized into reusable components, limited code duplication)
    f. Documentation and Comments (clear/concise code comments, appropriate use of documentation)

2.  **Category Scoring:** Assign a score (1-10) to each category:
    *   1-3: Poor
    *   4-6: Adequate
    *   7-8: Good
    *   9-10: Excellent

3. **Category Feedback:** For each category, provide:
    * a brief explanation of the assigned score
    * specific strengths and weaknesses observed in the provided code
    * actionable suggestions for improvement

4. **Overall Score Calculation:** Calculate an overall score by averaging the individual category scores.

**Summary Section:** Include a final summary section formatted as follows:
```
---
Overall Score: [Average of category scores]

PowerShell Code Quality Assessment Summary

Key Strengths:
- [Bullet point list of key strengths observed in the analysis]

Priority Improvements:
N. [Concise, actionable improvement point.]
   - [Brief explanation or example.]

General Recommendations:
- [Bullet points with general recommendations for code enhancement]
---
```
Ensure the summary is concise, clear, self-contained, and can easily be copied and shared with a developer. The summary should provide a quick overview of the quality and highlight actionable improvement points. Do not include any conversational sections, only results.