Skip to content

Feature: Add -PromptFromFile parameter to Invoke-QwenTask, Invoke-CodexTask, Invoke-GeminiTask #3

@eigenverft

Description

@eigenverft

Feature Request: Add -PromptFromFile Parameter to Task Cmdlets

Summary

Add a -PromptFromFile parameter to the following cmdlets to support reading prompts from external files:

  • Invoke-QwenTask
  • Invoke-CodexTask
  • Invoke-GeminiTask

Motivation

Currently, these cmdlets only accept prompts via the -Prompt parameter as inline strings. This creates several issues:

  1. Multiline prompts are difficult to handle - PowerShell here-strings can be cumbersome and error-prone when passed as arguments
  2. Large prompts clutter scripts - Long prompt templates make scripts harder to read and maintain
  3. No easy way to version prompt templates - Storing prompts in separate files allows better version control and reuse
  4. Encoding issues - Inline strings may have encoding/escaping problems with special characters

Proposed Solution

Add a new -PromptFromFile parameter that accepts a file path:

# Example usage
Invoke-QwenTask -PromptFromFile "C:\prompts\my-task-prompt.txt"

# Could also support relative paths
Invoke-CodexTask -PromptFromFile ".\prompts\analysis-prompt.md"

# Potential combination with other parameters
Invoke-GeminiTask -PromptFromFile "prompt.txt" -Model "gemini-pro"

Implementation Considerations

  1. Parameter validation - Ensure the file exists and is readable
  2. Encoding support - Support UTF-8 encoding (with/without BOM)
  3. Mutual exclusivity - -Prompt and -PromptFromFile should be mutually exclusive
  4. Error handling - Clear error messages if file cannot be read

Example Prompt File

Analyze the following code and identify potential security issues:

1. Check for SQL injection vulnerabilities
2. Look for hardcoded credentials
3. Identify missing input validation

Provide recommendations for each issue found.

Benefits

  • ✅ Cleaner scripts with separated concerns
  • ✅ Easy reuse of common prompt templates
  • ✅ Better support for complex/multiline prompts
  • ✅ Simpler prompt iteration and A/B testing
  • ✅ Team collaboration on prompt templates

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions