当前位置:网站首页>powershell_ View PowerShell function source code (environment variable / alias) / take function as parameter
powershell_ View PowerShell function source code (environment variable / alias) / take function as parameter
2022-07-02 04:05:00 【xuchaoxin1375】
see powershell Source code
reference
- magic accelerateViewing PowerShell Function Contents | PDQ.com
General solution
function showSrcCode
{
param(
[parameter(Mandatory = $true)]
# [scriptblock] $command
$command
)
Get-Command $command | Select-Object -ExpandProperty ScriptBlock
}
Invoke the sample
PS C:\Users\cxxu> showSrcCode -command newjunction
param(
$Path,
$Target
)
sudo New-Item -Verbose -ItemType junction -Path $Path -Target $Target
For a function
$function:<functionName>
$function: Invoke the sample
PS C:\Users\cxxu> $Function:newJunction
param(
$Path,
$Target
)
sudo New-Item -Verbose -ItemType junction -Path $Path -Target $Target
environment variable
$env:<environmentName>
Alias
$alias:<AliasName>
边栏推荐
- Microsoft Research Institute's new book "Fundamentals of data science", 479 Pages pdf
- Where can I buy cancer insurance? Which product is better?
- 毕设-基于SSM电影院购票系统
- Pandora IOT development board learning (RT thread) - Experiment 1 LED flashing experiment (learning notes)
- 10 minutes to understand CMS garbage collector in JVM
- Demonstration description of integrated base scheme
- The 7th Blue Bridge Cup single chip microcomputer provincial competition
- PR zero foundation introductory guide note 2
- 微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
- SQL Yiwen get window function
猜你喜欢

Qt插件之Qt Designer插件实现

Force buckle 540 A single element in an ordered array

树莓派GPIO引脚控制红绿灯与轰鸣器

Influence of air resistance on the trajectory of table tennis

C语言:逻辑运算和判断选择结构例题

What is 5g industrial wireless gateway? What functions can 5g industrial wireless gateway achieve?

【无线图传】基于FPGA的简易无线图像传输系统verilog开发,matlab辅助验证

The first game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup

Flutter中深入了解MaterialApp,常用属性解析

Actual combat | use composite material 3 in application
随机推荐
JVM knowledge points
u本位合约爆仓清算解决方案建议
Monkey测试
【leetcode】34. Find the first and last positions of elements in a sorted array
Go语言介绍
Go variables and constants
【c语言】动态规划---入门到起立
Spring recruitment of Internet enterprises: Kwai meituan has expanded the most, and the annual salary of technical posts is up to nearly 400000
BGP experiment the next day
微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
Lei Jun wrote a blog when he was a programmer. It's awesome
软件测试人的第一个实战项目:web端(视频教程+文档+用例库)
Three ways for programmers to learn PHP easily and put chaos out of order
The 10th Blue Bridge Cup single chip microcomputer provincial competition
PR zero foundation introductory guide note 2
[tips] use Matlab GUI to read files in dialog mode
LCM of Spreadtrum platform rotates 180 °
Li Kou interview question 02.08 Loop detection
It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years
QT designer plug-in implementation of QT plug-in