您现在的位置是:网站首页> 编程资料编程资料
Powershell的break、continue和return简单总结_PowerShell_
2023-05-26
1259人已围观
简介 Powershell的break、continue和return简单总结_PowerShell_
在Powershell中有两个特殊的关键字,就是你使用在循环中的break和continue.
看下这个“continue”,循环中的继续就是跳过其中的剩余代码。当你使用一个”break”,这个循环将提前结束但是会返回当前所有结果。
除此之外,关键字“return”,它将马上退出当前的作用域。所以当你在函数中执行“return”,这时函数将会结束,同时当你在脚本中执行“return”,这时脚本也将结束。
您可能感兴趣的文章:
相关内容
- 了解Powershell中的Exit函数_PowerShell_
- Powershell获取图片名字、文件夹及拍摄时间的例子_PowerShell_
- PowerShell默认参数$PSDefaultParameterValues结合Out-File输出到日志文件_PowerShell_
- Powershell批量给文件增加前辍实例_PowerShell_
- PowerShell把文件删除到回收站的方法_PowerShell_
- PowerShell脚本性能优化技巧总结_PowerShell_
- powershell操作word详解_PowerShell_
- PowerShell中运行CMD命令的技巧总结(解决名称冲突和特殊字符等问题)_PowerShell_
- Powershell使用WPF技术实现弹窗提示实例_PowerShell_
- PowerShell注册表操作命令总结_PowerShell_
