当前位置:网站首页>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>
边栏推荐
- Déchirure à la main - tri
- SQL Yiwen get window function
- It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years
- Suggestions on settlement solution of u standard contract position explosion
- regular expression
- Where can I buy cancer insurance? Which product is better?
- How to solve the code error when storing array data into the database
- Go branch and loop
- FAQ | FAQ for building applications for large screen devices
- MySQL advanced SQL statement 2
猜你喜欢
The 7th Blue Bridge Cup single chip microcomputer provincial competition
Go language introduction
u本位合约爆仓清算解决方案建议
Didi open source Delta: AI developers can easily train natural language models
The 9th Blue Bridge Cup single chip microcomputer provincial competition
PR zero foundation introductory guide note 2
一文彻底理解评分卡开发中——Y的确定(Vintage分析、滚动率分析等)
《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
The 8th Blue Bridge Cup single chip microcomputer provincial competition
Sorted out an ECS summer money saving secret, this time @ old users come and take it away
随机推荐
Monkey test
Recyclerview add header
Lost a few hairs, and finally learned - graph traversal -dfs and BFS
Wechat applet - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
Visual slam Lecture 3 -- Lie groups and Lie Algebras
Installation et utilisation du lac bleu
Flutter中深入了解MaterialApp,常用属性解析
Influence of air resistance on the trajectory of table tennis
Li Kou interview question 02.08 Loop detection
向数据库中存入数组数据,代码出错怎么解决
"No war on the Western Front" we just began to love life, but we had to shoot at everything
Go language naming specification
Introduction to vmware workstation and vSphere
[untitled]
uni-app - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
66.qt quick-qml自定义日历组件(支持竖屏和横屏)
Vite: configure IP access
Is the product of cancer prevention medical insurance safe?
[personal notes] PHP common functions - custom functions
Use a mask to restrict the input of the qlineedit control