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
Copy file name to clipboardExpand all lines: documentation/development-docs/azure-powershell-developer-guide.md
+11-14Lines changed: 11 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -214,22 +214,19 @@ There are a few existing projects that need to be added before developing any cm
214
214
Please check out the [_Cmdlet Best Practices_](./design-guidelines/cmdlet-best-practices.md) document for more information on how to create cmdlets that follow the PowerShell guidelines.
215
215
216
216
## Enable Running PowerShell when Debugging
217
-
217
+
To import modules automatically when debug has started, follow the below steps:
218
+
### Set a StartUp Project
218
219
- Choose any project and set it as the startup project in Visual Studio
219
220
- Right click on your project in the **Solution Explorer** and select **Set as StartUp project**
220
-
- Right-click on the project and select **Properties**
221
-
- Go to the **Debug** tab
222
-
- Under **Start Action**, pick _Start external program_ and type the PowerShell 6.0 directory
223
-
- For example, `C:\Program Files\PowerShell\6\pwsh.exe`
224
-
225
-
### Importing Modules
226
-
227
-
To import modules automatically when debug has started, follow the below steps:
228
-
229
-
- In the **Debug** tab mentioned previously, go to **Start Options**
230
-
- Import the Profile module, along with the module you are testing, by pasting the following in the **Command line arguments** box (_note_: you have to update the <PATH_TO_REPO> and <SERVICE> values provided below):
-**Note**: if you do not see all of the changes you made to the cmdlets when importing your module in a PowerShell session (_e.g.,_ a cmdlet you added is not recognized as a cmdlet), you may need to delete any existing Azure PowerShell modules that you have on your machine (installed through the PowerShell Gallery) before you import your module.
221
+
### Setup a Debug Profile
222
+
- Please refer to [Debug Page, Project Designer](https://learn.microsoft.com/visualstudio/ide/reference/debug-page-project-designer?view=vs-2022) for how to access the Debug page
223
+
- Create a **Excutable** new Debug profile
224
+
- For Azure PowerShell, please setup debug profile in the following way
225
+
- Set **Excutable** to the path of the excutable file of PowerShell core, for example,`C:\Program Files\PowerShell\7\pwsh.exe`
226
+
- Import the Profile module, along with the module you are testing, by pasting the following in the **Command line arguments** box (_note_: you have to update the <PATH_TO_REPO> and <SERVICE> values provided below):
**Note**: if you do not see all of the changes you made to the cmdlets when importing your module in a PowerShell session (_e.g.,_ a cmdlet you added is not recognized as a cmdlet), you may need to delete any existing Azure PowerShell modules that you have on your machine (installed through the PowerShell Gallery) before you import your module.
0 commit comments